From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00, BUG6152_INVALID_DATE_TZ_ABSURD,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS,INVALID_DATE_TZ_ABSURD,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F2445C43219 for ; Tue, 19 Jan 2021 09:41:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C01EF23135 for ; Tue, 19 Jan 2021 09:41:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732893AbhASJZa (ORCPT ); Tue, 19 Jan 2021 04:25:30 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:33432 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726839AbhASIzv (ORCPT ); Tue, 19 Jan 2021 03:55:51 -0500 From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1611046488; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=7MbaMnom2K7PhdZRqxLxAfNSuvZ5xFrlBT8r1CAnJI0=; b=j+YYWWVUXysN4rhWK6ZkteYIJage8SlMS9C1YixUA8rzRTjzNC/vLJGQ5WudQVcZYlcCep bTa6zc0W2oCkVi8OwFtG/LsyP6zN8AEhZxlIgYSYYoMi+aTyNLeotmsd2xUMKVCKfxiNln ftjEyIFuxDlBZxZSAWUJPQXgBEnXQn++XC6b7X4AIrKO2wvmFZYuzti5aLUuMAhM5a5eUk jZ1Jwtg1H0c6EU/DyEyYXG+6sWVCBI7hgnIlT0uFg511xiiYXCdBQzDakqqnh/mAKOhMOu QEMy20lz86VIHxl5DX/+u/B/SUJezqJNz2xXctXuVydi5N5LwwKE069g/Dxlyg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1611046488; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=7MbaMnom2K7PhdZRqxLxAfNSuvZ5xFrlBT8r1CAnJI0=; b=5+1x2VrnYSkxyyJXDMXfHYJ/N1Jg5uYARPAXCOsmB8dUgtESeIhOoCGd6nANdMaECTS0g1 1GSLwsmjQ0oTh5AQ== To: Sergey Senozhatsky , Petr Mladek Cc: Sergey Senozhatsky , Sergey Senozhatsky , Steven Rostedt , Linus Torvalds , linux-kernel@vger.kernel.org Subject: Re: [PATCH] printk: fix buffer overflow potential for print_text() In-Reply-To: References: <20210114170412.4819-1-john.ogness@linutronix.de> Date: Tue, 19 Jan 2021 10:00:47 +0106 Message-ID: <87r1mh5mso.fsf@jogness.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021-01-19, Sergey Senozhatsky wrote: > John, how did you spot these problems? I am preparing my series to remove the logbuf_lock, which also refactors and consolidates code from syslog_print_all() and kmsg_dump_get_buffer(). While testing/verifying my series, I noticed the these oddities in the semantics and decided I should research where they came from and if they were actually necessary. I wouldn't say the oddities are necessary (in fact, they are quite annoying), but we have decided to keep them in out of fear of breaking out-of-tree modules and/or interesting userspace code. One positive effect of the rework is that we are finding these oddities and documenting them. I think you and Petr are going down a similar path with the console registration stuff now. John