Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2691621pxb; Tue, 19 Jan 2021 03:51:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJwmYKDq5jNIzf8vuBQsMen62K40vWKMDbciB1IeUt2j2IEkrUvotLi6E4oRd+9ZdsNJ/Lr+ X-Received: by 2002:a17:906:36d4:: with SMTP id b20mr2708309ejc.144.1611057100587; Tue, 19 Jan 2021 03:51:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611057100; cv=none; d=google.com; s=arc-20160816; b=BWWc8Plk7BiL6W2J+/hBw3QDO4nUqxjC6MHWFiPBb5eslCg8lUXd27Na/AWZSLeQt7 tAXnLwSY/kuWqnYLPeia9nVTSdI+lCuZFcadVnTuD3uMqMdCw8QUDMmOoJZnQcQpPZdK fEAATjtg0PiT2PJMwN5vdx0YGQJkrCIycIqWzATsZzdRax48gtuPNm+HLOy/1a8WMYR0 hkyFn5eD9W+653aMnzP66+CN11JcTrB0TbC43iPxMkYnZrgr/90h7tcsf+urzERJPAN4 t7B1AoGGUVxcyX7Qo6is+27uUa/wB7A6Fi1Um4X1Lyz/73854ClPQ9tWGfCWhu8mPmWd QgsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Qxx4tooN9pY52eWelOpuS9rLDNjCrg58Wch5BtDwzh0=; b=xCICd5HxLji9xAXxaN94Z+/YO+hSfK+0dIyxLOAE7feInUZz6x0vAY/CaoNjLTgQKu hhHZWND010v/DhgweZtrzmgepquNtETOgbt4eFtThIt18hvlUmlwmPHBHeHy1SCIVU3h jl6lSEY8go5uyOrR6zQXjvoi8yfPU9pY4PHFmnd8ej7cZJ9pzEZoVLwxcrKwNyNrnbt1 lha7+KLJY8tsLQUd8olLExBY1xaWvAkN4W8Cla0zmiDEXwSTbrtMbH48J2qayBWXP3I4 wSSaVG/M9QAvW3Inqct5YlX86v1ywLivdN5yJGXZb/MkRqqmMsi9lmu27UPk+sBzvJab DZ2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bhFNGSdL; 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=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id fi14si8113226ejb.677.2021.01.19.03.51.17; Tue, 19 Jan 2021 03:51:40 -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=@gmail.com header.s=20161025 header.b=bhFNGSdL; 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=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390990AbhASKvr (ORCPT + 99 others); Tue, 19 Jan 2021 05:51:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390593AbhASKaY (ORCPT ); Tue, 19 Jan 2021 05:30:24 -0500 Received: from mail-pg1-x533.google.com (mail-pg1-x533.google.com [IPv6:2607:f8b0:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 78D29C061573 for ; Tue, 19 Jan 2021 02:29:39 -0800 (PST) Received: by mail-pg1-x533.google.com with SMTP id i7so12699517pgc.8 for ; Tue, 19 Jan 2021 02:29:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=Qxx4tooN9pY52eWelOpuS9rLDNjCrg58Wch5BtDwzh0=; b=bhFNGSdL6YGi5PDkvPJWBni6uzhgfPOjKwPeeKmFgvQJrkJ4YLPGW5qHCxjDgM9kv0 mmuVOY6k+U3Mreja/LFMKm9PPLO/cwb5nRIQOJm4tTAFLQ7ijCPFShPwAwsAMf5WF+Mg s2LI6j1/nsKZ0fdL5jKg+/ZfjsJ9Ta8X8Wac4LRYUs+kANW0rYNl70Z3x9umEIZiutz6 MNIL3zyfMmgcORP1EPlY24DELsycpcWkTvWkWHYeqnnb3mIUdtQZDBkLtlW3pQ+HW4zv G36cTDVs9P5cQQqzjfQQF/dcMM1rSt/j9rwjrVZ31VXi9ZlvzQe4mAdMErTkPdD6Y7sl U2fA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Qxx4tooN9pY52eWelOpuS9rLDNjCrg58Wch5BtDwzh0=; b=tgLiASzMO5VNID3lz+IWeDXxwF0GVe8wFDmVxRcpYCNgMxLotHDthyyVOrgJIzT51O uPaz83hC2apeabH4Euh7FKNkRGpRNmlwQmUVuVy26W+hs7yconAbtWPF9oG9M0M4uu9G 71IQH5BW+Y5jBhyukM5uPvefc6GegUqaRhSSrjdheA4L/SQLRBP5dpCINcN84oNN4fUX 0d0RV0Vkvub6tRK1EphLmte6emxwE4+J4RuF5aAwkWxGmxB3BGgNeMYA4+/JsKn3Tmei P6294MHH/R2W1JEJ/rCbTBeZugVNxuVfDw3y3SyJMus5FUG0oWxNJATwJu59UzX5ULAx wHZQ== X-Gm-Message-State: AOAM5321t6Q2FkMqeC17uSKYR1Y0E7R/TUNiablR7eL8+8Qb1hh0jh3U SZ1Sc9dpzrILUZ9MfMTjV24= X-Received: by 2002:a63:6686:: with SMTP id a128mr3764766pgc.96.1611052178925; Tue, 19 Jan 2021 02:29:38 -0800 (PST) Received: from localhost ([2409:10:2e40:5100:6e29:95ff:fe2d:8f34]) by smtp.gmail.com with ESMTPSA id i6sm18734317pgc.58.2021.01.19.02.29.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Jan 2021 02:29:37 -0800 (PST) Date: Tue, 19 Jan 2021 19:29:35 +0900 From: Sergey Senozhatsky To: John Ogness Cc: Sergey Senozhatsky , Petr Mladek , Sergey Senozhatsky , Steven Rostedt , Linus Torvalds , linux-kernel@vger.kernel.org Subject: Re: [PATCH] printk: fix buffer overflow potential for print_text() Message-ID: References: <20210114170412.4819-1-john.ogness@linutronix.de> <87r1mh5mso.fsf@jogness.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87r1mh5mso.fsf@jogness.linutronix.de> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (21/01/19 10:00), John Ogness wrote: > 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. Any chance you can put those tests somewhere public so that we can run them regularly? (say, before Petr sends out a pull request to Linus.) > 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. Sure. > One positive effect of the rework is that we are finding these oddities > and documenting them. Absolutely agree. -ss