Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2727157pxb; Tue, 19 Jan 2021 04:47:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJwRhwlj3XvRRbM0nR5a0+1n8kuJBAOK+iLK83LMEseqxfibHcIkNxCi54oosnd5nAnOh7u/ X-Received: by 2002:a05:6402:c16:: with SMTP id co22mr2811632edb.175.1611060423234; Tue, 19 Jan 2021 04:47:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611060423; cv=none; d=google.com; s=arc-20160816; b=eknanvlyevrZOFJk8Ki7RkUqklzujh/7wdQn+JGFurx8WwFSpw/rgm1NKHr+13wkVR GSfIZjAhrFzUvLXXMzzq5qt21MUC4QqCEszFSXBljVRHr3XMi5sZVa6HaW+WpPIsrJMM QdXz0dFU6pXj2aEhWDrctuEW/UgFECC9yGCBYxdZBxfjDCh5Q5swzbnRB+1FBXq6YRIG aZ95Ai9OhkHpe5mEFNUEl8eVjNeV7+us7f/qUiou4l+x/swjM2w4luHk8WjIH+ARrG9b 5ZqJdrG16iNlB3OKGEB2UG9FIn2hT/8Ez+TObgtH3N1e5fOu90N42HkoRcqV+jQZhV8e 3QJA== 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=kzOjM95fJedKhanGDes7Gs/np2Mc8EB1YqmNdBhWlW0=; b=vuXOAfM81q/ft62MipzsLv2C5pA8+q5eBCfvJYDzuzQanLQQCsAoYAb1c8YCmu5kkS AwZyHrf8zasmV0bq/c/IHfRf3YYZH6vq2BQH31w/fCRTbkpKlRQPWzuHeuiPnVqh0EgT SXyej4aYly4AvchFUR2faJxCMIb9ewNwaNaODz7Etze/TwoTrjPK0zAdpHkl8zFr8QjO jUDPWxXM3tk/DsHQtHRuQ8JVribVUUAr0qi8YBvzMC4xiFYjynJ8q9sqnvghZ21FHDXD /haD81WbxcCGvIAVn+fcsn1dejLwlIbtssEdwFC9NYNc9BsQUY1bRwxSpclwgmzspziP knew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=HsvHysxL; 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=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u4si4514889ejx.708.2021.01.19.04.46.39; Tue, 19 Jan 2021 04:47:03 -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=@suse.com header.s=susede1 header.b=HsvHysxL; 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=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390716AbhASM2z (ORCPT + 99 others); Tue, 19 Jan 2021 07:28:55 -0500 Received: from mx2.suse.de ([195.135.220.15]:57844 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387414AbhASMXA (ORCPT ); Tue, 19 Jan 2021 07:23:00 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1611058923; h=from:from:reply-to: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=kzOjM95fJedKhanGDes7Gs/np2Mc8EB1YqmNdBhWlW0=; b=HsvHysxL/+Ozf2nxPNfuID3A/uqizmc/x30cu3vnqls0uKtM6x+I8/x3hZieIRIKldul2Q N1O7TvUCy9dTjwvDtmNhuIUUQaLk9X9rBsNy6mM/rC9iqtxeKOkCqLkKVUBq73T9eD5rON t2Bz/wJS8NkcEML5hcK6/BAf08o/Tno= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id A0DFEAC6E; Tue, 19 Jan 2021 12:22:03 +0000 (UTC) Date: Tue, 19 Jan 2021 13:22:02 +0100 From: Petr Mladek To: John Ogness 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() Message-ID: References: <20210114170412.4819-1-john.ogness@linutronix.de> <87r1mh5mso.fsf@jogness.linutronix.de> <87bldl5exc.fsf@jogness.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87bldl5exc.fsf@jogness.linutronix.de> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 2021-01-19 12:50:47, 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? Great idea. > I have a collection of hacked-together tools that I use to test most of > the various interfaces of printk. I would need to clean them up if they > should be used for any kind of automated regression testing. Sounds good. We could even help with the clean up. This kind of code always need it when it was not written for public use from scratch. > And where should I make such things available? I could put them in a > repo in the Linutronix github account (like I did for the ringbuffer > stress testing tool). (??) Sounds good as well. Best Regards, Petr