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.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,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 AB227C433DB for ; Tue, 19 Jan 2021 12:35:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6826C22CE3 for ; Tue, 19 Jan 2021 12:35:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392875AbhASMaT (ORCPT ); Tue, 19 Jan 2021 07:30:19 -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