Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2630741pxb; Tue, 19 Jan 2021 01:59:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJyP47grRf6Zc3NO6YrKV5cXxodWUYIy0/hfsgzdZhN1/UEuoEV6S5Vlnm3TvYCNBUVgkgn6 X-Received: by 2002:aa7:d8c6:: with SMTP id k6mr2755808eds.265.1611050379480; Tue, 19 Jan 2021 01:59:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611050379; cv=none; d=google.com; s=arc-20160816; b=nR+t52bVJixO1t5UtFoUGBCS4jMCZnHwJM8je5U1835yH6r8xOLlkfAIEPPmTY6Hte OljrQ8kDn4+kRtkkA4RAewiqUKxDWKHzp2xskuHGCyKEfv43OS3kS8QnKIqpdbH/UNmN NmNctkIa+qVIRQgJi2Ijb6ti6Od/2bDqqeBocmfFec6UDToRnDxNbpCIEuNJsJ4CGP6K XqQnIyRppISpRr/SnFWZiR1BYp30PLuYCjQPnIOx9yEC00Tmvgl0LblCIOlc0aDOjH7f D3bI1l5vNIlRf9usd0F1PC2qmJTeS6ThR6yZeyQ+kyW0x30On04n5bSuFO3EEV1hGF1/ ohSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=7MbaMnom2K7PhdZRqxLxAfNSuvZ5xFrlBT8r1CAnJI0=; b=xCG5C9bEYDllRh0x08edxgX7/JXxSa2U+7K9Gov4rm71gMiPDTnDRSl6Ad/Ld+bS+6 4lCm+LrcCop0fqBS57OlUZnWA5+Ir8hTpXSgSTZDLSLRgbEhVPZyzipfJTyYu5wT1k7E wtJ6LE9K1D2aPqTW67yZ42DF71zlPF/0Tf2sZRwr3p4rZkccDZ9PZJhob6bC0l0ol4+Y QGOlc1Ysx9+B2y9TcHzDQj8DSwX67DwoNWNGzZlA5/4aOyyzn+Xs1cGmFIyjt9Co/uQG FIorOacce8fdqxrhsqfa5Wz5pwxuX1Gc7tSVYFDYemzbcPASadqGVSMSZOwYPxVMOSUJ +v8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=j+YYWWVU; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=5+1x2Vrn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v26si1290004ejx.316.2021.01.19.01.59.07; Tue, 19 Jan 2021 01:59:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=j+YYWWVU; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=5+1x2Vrn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732872AbhASJZ0 (ORCPT + 99 others); Tue, 19 Jan 2021 04:25:26 -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