LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Tycho Andersen <tycho@tycho.pizza>
To: Kees Cook <keescook@chromium.org>
Cc: "Peter Zijlstra" <peterz@infradead.org>,
	"Tobin C. Harding" <me@tobin.cc>,
	linux-hardening@vger.kernel.org,
	"kernel test robot" <oliver.sang@intel.com>,
	"Vito Caputo" <vcaputo@pengaru.com>,
	"Jann Horn" <jannh@google.com>, "Ingo Molnar" <mingo@redhat.com>,
	"Juri Lelli" <juri.lelli@redhat.com>,
	"Vincent Guittot" <vincent.guittot@linaro.org>,
	"Dietmar Eggemann" <dietmar.eggemann@arm.com>,
	"Steven Rostedt" <rostedt@goodmis.org>,
	"Ben Segall" <bsegall@google.com>, "Mel Gorman" <mgorman@suse.de>,
	"Daniel Bristot de Oliveira" <bristot@redhat.com>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Christian Brauner" <christian.brauner@ubuntu.com>,
	"Anand K Mistry" <amistry@google.com>,
	"Kenta.Tada@sony.com" <Kenta.Tada@sony.com>,
	"Alexey Gladkov" <legion@kernel.org>,
	"Michael Weiß" <michael.weiss@aisec.fraunhofer.de>,
	"Michal Hocko" <mhocko@suse.com>, "Helge Deller" <deller@gmx.de>,
	"Qi Zheng" <zhengqi.arch@bytedance.com>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"Borislav Petkov" <bp@alien8.de>,
	"H. Peter Anvin" <hpa@zytor.com>,
	"Mark Rutland" <mark.rutland@arm.com>,
	"Jens Axboe" <axboe@kernel.dk>,
	"Stefan Metzmacher" <metze@samba.org>,
	"Lai Jiangshan" <laijs@linux.alibaba.com>,
	"Andy Lutomirski" <luto@kernel.org>,
	"Dave Hansen" <dave.hansen@linux.intel.com>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	"Ohhoon Kwon" <ohoono.kwon@samsung.com>,
	"Kalesh Singh" <kaleshsingh@google.com>,
	"YiFei Zhu" <yifeifz2@illinois.edu>,
	"Josh Poimboeuf" <jpoimboe@redhat.com>,
	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
Date: Thu, 30 Sep 2021 08:37:15 -0600	[thread overview]
Message-ID: <YVXLm5dC3nRKZpF3@cisco> (raw)
In-Reply-To: <20210929220218.691419-7-keescook@chromium.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" <me@tobin.cc>
> Cc: Tycho Andersen <tycho@tycho.pizza>

Acked-by: Tycho Andersen <tycho@tycho.pizza>

Thanks!

> Cc: linux-hardening@vger.kernel.org
> Signed-off-by: Kees Cook <keescook@chromium.org>
> ---
>  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
> 

  reply	other threads:[~2021-09-30 14:38 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-29 22:02 [PATCH v2 0/6] wchan: Fix ORC support and leaky fallback Kees Cook
2021-09-29 22:02 ` [PATCH v2 1/6] Revert "proc/wchan: use printk format instead of lookup_symbol_name()" Kees Cook
2021-09-29 22:02 ` [PATCH v2 2/6] sched: Add wrapper for get_wchan() to keep task blocked Kees Cook
2021-09-30  8:27   ` Peter Zijlstra
2021-09-30  8:28     ` Peter Zijlstra
2021-09-30  8:29       ` Peter Zijlstra
2021-09-29 22:02 ` [PATCH v2 3/6] proc: Use task_is_running() for wchan in /proc/$pid/stat Kees Cook
2021-09-29 22:02 ` [PATCH v2 4/6] proc: Only report /proc/$pid/wchan when process is blocked Kees Cook
2021-09-29 22:02 ` [PATCH v2 5/6] x86: Fix get_wchan() to support the ORC unwinder Kees Cook
2021-09-29 22:02 ` [PATCH v2 6/6] leaking_addresses: Always print a trailing newline Kees Cook
2021-09-30 14:37   ` Tycho Andersen [this message]
2021-09-30  1:01 ` [PATCH v2 0/6] wchan: Fix ORC support and leaky fallback Josh Poimboeuf
2021-09-30  8:40   ` Peter Zijlstra
2021-09-30 15:18     ` Kees Cook
2021-09-30 18:39       ` Peter Zijlstra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YVXLm5dC3nRKZpF3@cisco \
    --to=tycho@tycho.pizza \
    --cc=Kenta.Tada@sony.com \
    --cc=akpm@linux-foundation.org \
    --cc=amistry@google.com \
    --cc=axboe@kernel.dk \
    --cc=bp@alien8.de \
    --cc=bristot@redhat.com \
    --cc=bsegall@google.com \
    --cc=christian.brauner@ubuntu.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=deller@gmx.de \
    --cc=dietmar.eggemann@arm.com \
    --cc=ebiederm@xmission.com \
    --cc=hpa@zytor.com \
    --cc=jannh@google.com \
    --cc=jpoimboe@redhat.com \
    --cc=juri.lelli@redhat.com \
    --cc=kaleshsingh@google.com \
    --cc=keescook@chromium.org \
    --cc=laijs@linux.alibaba.com \
    --cc=legion@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=me@tobin.cc \
    --cc=metze@samba.org \
    --cc=mgorman@suse.de \
    --cc=mhocko@suse.com \
    --cc=michael.weiss@aisec.fraunhofer.de \
    --cc=mingo@redhat.com \
    --cc=ohoono.kwon@samsung.com \
    --cc=oliver.sang@intel.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=vcaputo@pengaru.com \
    --cc=vincent.guittot@linaro.org \
    --cc=x86@kernel.org \
    --cc=yifeifz2@illinois.edu \
    --cc=zhengqi.arch@bytedance.com \
    --subject='Re: [PATCH v2 6/6] leaking_addresses: Always print a trailing newline' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).