Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp386321pxb; Thu, 30 Sep 2021 08:09:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwkaT0Gb3flAq+VIDVP0a/ub1jpEz3+5/9+t6c7IHmLOwMrx2pyDgv3C9VcWbUaGFXhQBMH X-Received: by 2002:a17:906:3fc1:: with SMTP id k1mr7627589ejj.44.1633014546497; Thu, 30 Sep 2021 08:09:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633014546; cv=none; d=google.com; s=arc-20160816; b=WHJHrIbBDUHtwvj+jxVjNUYPD4QJfZZNYRzpU5PCXIjLNQzdmfcM5Kyo/tVM66hIPr iZHd8ju0b999MQRMLWCRmH48YiJDqHxPXnQMMYVO/S/ihD90CmTRb7XQLWf0vX0wZpXu Ra5s+bE9mHKkASgBSukEligfP05G9UtxnXRZJGJVhxvdNCJtOkNSGSa+DIvkRo6T1SoH IklnIK8HDwem3voAQ8O4W01lgTQ8CzHAoSLM9WOt5XS7QwhVmlBvddrxkljfWVkAU2LZ KiGCQfmEuY0JHFviTqQhE/IYU+SNSyX5yctcPVP8ZeSs1qzHzd4rffumWoT1dIHKlO3Z 5TMQ== 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 :dkim-signature; bh=mx+31OMai8gbaIunBA/PcL9q6BGp95XY+PT2AgPSDuI=; b=bMWOVCuzE0Y9/fjnoVg53/anzjAtK/cV5ibMyUmsEb8RKwsY88EAm5coDfefgHvotD btGUFTg5Za0Ey9HAYFsyf/hAfldVPcjbWqzKU0elWL/b5g7SRGOiGsBR8Ampj19q/IVf a49a28M9KZqyBPA9Yz2RPz9a8kLtDE4qNNFy/ww4ucC0TSDaOBPW31sDdXvZCsR0mEP6 I73RJR6htM5WPKPKEnrPwXJZ9Q81UWgRlI9qnVfN/YTw8AsImeAzDZ+E0/10/7j/8AT4 iE3y7k2eyxY56Fy5jrufsFdYa3ly8PaeY76BSPAVZhybw+cP6SK45gRBZnQJjsnZ5WjC yZIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tycho.pizza header.s=fm1 header.b=JYAPl8xu; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=Hkeiyi6U; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 8si4338446ejn.389.2021.09.30.08.08.41; Thu, 30 Sep 2021 08:09:06 -0700 (PDT) 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=@tycho.pizza header.s=fm1 header.b=JYAPl8xu; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=Hkeiyi6U; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350687AbhI3OkA (ORCPT + 99 others); Thu, 30 Sep 2021 10:40:00 -0400 Received: from new1-smtp.messagingengine.com ([66.111.4.221]:53643 "EHLO new1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348440AbhI3OjS (ORCPT ); Thu, 30 Sep 2021 10:39:18 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailnew.nyi.internal (Postfix) with ESMTP id 5A9F8580F9A; Thu, 30 Sep 2021 10:37:23 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Thu, 30 Sep 2021 10:37:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tycho.pizza; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm1; bh=mx+31OMai8gbaIunBA/PcL9q6BG p95XY+PT2AgPSDuI=; b=JYAPl8xuiMqjPKgj4D5TmY/fbL5ORVlyC8IMByPJoSf rFfBL+JSOjLRSdKL5CxCCD28WWHdKcS8bZLdyvoJhjwKWH6QZC36Q9HENw8S3H77 6B5Rgt4ZU4WTAV64E2nivZ67w8+8v4Paz5nXCYViB/AyUQKWk4LL3uXMIzKTYdxa 7+9k0AB3UFf+ffa9LLX4bZO4LAm4UavnOc4TA8kjhJZGsXXAqRvOghy6oouQsE4u 6RLOrZF/jczhlgtVmGDzW9s6KZTvc3joQP+GcZA7Ym5h3ZbzOBB0I6R1V7+l8o16 oJ9pRD4b7y1v2wQoKeQAplg3SA7qJgd2iAj7rglptkA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=mx+31O Mai8gbaIunBA/PcL9q6BGp95XY+PT2AgPSDuI=; b=Hkeiyi6U0uImqNh8Q55Fxq 5Nry+jvvYAqpMOLpeP4TG0HnSix9czmk62R+t3LeuI5Bv6MySvwi4cf+RYZneYjc qrefVFoLOHlnXPM2AB4rdk9IyYKJn68YAtyH1/ZMUWmw/bpx3WBKXoA7cius8Mm4 FfQMp9tWPexnRflXcF4Sb7yqvNiHssoatzJMX7EEiNfWyAb7v9pRgYy30eZQjLfA eWjBtrGfFqqsPHwl9qKRKxe3T9mNOGVIYX036yJ8sOT7DQbBoQ+8I4EZf5WCc1vB PwRJLl9toGEyM3Ki6HXQV2BPclPvLwYsIfgLQlGWvIeGvxrmefEn75pjb8H8B7Dg == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudekgedgjeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdluddtmdenucfjughrpeffhffvuffkfhggtggujgesthdtredttddt vdenucfhrhhomhepvfihtghhohcutehnuggvrhhsvghnuceothihtghhohesthihtghhoh drphhiiiiirgeqnecuggftrfgrthhtvghrnhepffeukeekudejfefhjeevgeejgffhkefh ffetleduvddufeekteelkeekhfefudejnecuffhomhgrihhnpehkvghrnhgvlhdrohhrgh enucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthigt hhhosehthigthhhordhpihiiiigr X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 30 Sep 2021 10:37:17 -0400 (EDT) Date: Thu, 30 Sep 2021 08:37:15 -0600 From: Tycho Andersen To: Kees Cook Cc: Peter Zijlstra , "Tobin C. Harding" , linux-hardening@vger.kernel.org, kernel test robot , Vito Caputo , Jann Horn , Ingo Molnar , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Andrew Morton , Christian Brauner , Anand K Mistry , "Kenta.Tada@sony.com" , Alexey Gladkov , Michael =?iso-8859-1?Q?Wei=DF?= , Michal Hocko , Helge Deller , Qi Zheng , Thomas Gleixner , Borislav Petkov , "H. Peter Anvin" , Mark Rutland , Jens Axboe , Stefan Metzmacher , Lai Jiangshan , Andy Lutomirski , Dave Hansen , "Eric W. Biederman" , Ohhoon Kwon , Kalesh Singh , YiFei Zhu , Josh Poimboeuf , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, x86@kernel.org Subject: Re: [PATCH v2 6/6] leaking_addresses: Always print a trailing newline Message-ID: References: <20210929220218.691419-1-keescook@chromium.org> <20210929220218.691419-7-keescook@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210929220218.691419-7-keescook@chromium.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 29, 2021 at 03:02:18PM -0700, Kees Cook wrote: > For files that lack trailing newlines and match a leaking address (e.g. > wchan[1]), the leaking_addresses.pl report would run together with the > next line, making things look corrupted. > > Unconditionally remove the newline on input, and write it back out on > output. > > [1] https://lore.kernel.org/all/20210103142726.GC30643@xsang-OptiPlex-9020/ > > Cc: "Tobin C. Harding" > Cc: Tycho Andersen Acked-by: Tycho Andersen Thanks! > Cc: linux-hardening@vger.kernel.org > Signed-off-by: Kees Cook > --- > scripts/leaking_addresses.pl | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/scripts/leaking_addresses.pl b/scripts/leaking_addresses.pl > index b2d8b8aa2d99..8f636a23bc3f 100755 > --- a/scripts/leaking_addresses.pl > +++ b/scripts/leaking_addresses.pl > @@ -455,8 +455,9 @@ sub parse_file > > open my $fh, "<", $file or return; > while ( <$fh> ) { > + chomp; > if (may_leak_address($_)) { > - print $file . ': ' . $_; > + printf("$file: $_\n"); > } > } > close $fh; > -- > 2.30.2 >