[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20211008111626.151570317@infradead.org>
Date: Fri, 08 Oct 2021 13:15:29 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: keescook@...omium.org, jannh@...gle.com
Cc: linux-kernel@...r.kernel.org, peterz@...radead.org,
vcaputo@...garu.com, mingo@...hat.com, juri.lelli@...hat.com,
vincent.guittot@...aro.org, dietmar.eggemann@....com,
rostedt@...dmis.org, bsegall@...gle.com, mgorman@...e.de,
bristot@...hat.com, akpm@...ux-foundation.org,
christian.brauner@...ntu.com, amistry@...gle.com,
Kenta.Tada@...y.com, legion@...nel.org,
michael.weiss@...ec.fraunhofer.de, mhocko@...e.com, deller@....de,
zhengqi.arch@...edance.com, me@...in.cc, tycho@...ho.pizza,
tglx@...utronix.de, bp@...en8.de, hpa@...or.com,
mark.rutland@....com, axboe@...nel.dk, metze@...ba.org,
laijs@...ux.alibaba.com, luto@...nel.org,
dave.hansen@...ux.intel.com, ebiederm@...ssion.com,
ohoono.kwon@...sung.com, kaleshsingh@...gle.com,
yifeifz2@...inois.edu, jpoimboe@...hat.com,
linux-hardening@...r.kernel.org, linux-arch@...r.kernel.org,
vgupta@...nel.org, linux@...linux.org.uk, will@...nel.org,
guoren@...nel.org, bcain@...eaurora.org, monstr@...str.eu,
tsbogend@...ha.franken.de, nickhu@...estech.com,
jonas@...thpole.se, mpe@...erman.id.au, paul.walmsley@...ive.com,
hca@...ux.ibm.com, ysato@...rs.sourceforge.jp, davem@...emloft.net,
chris@...kel.net
Subject: [PATCH 2/7] leaking_addresses: Always print a trailing newline
From: Kees Cook <keescook@...omium.org>
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/
Signed-off-by: Kees Cook <keescook@...omium.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
---
scripts/leaking_addresses.pl | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- 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;
Powered by blists - more mailing lists