Skip to content

Commit e1d7f02

Browse files
keesgregkh
authored andcommitted
leaking_addresses: Always print a trailing newline
[ Upstream commit cf2a85e ] 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@chromium.org> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lkml.kernel.org/r/20211008111626.151570317@infradead.org Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 9101e25 commit e1d7f02

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

scripts/leaking_addresses.pl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,8 +455,9 @@ sub parse_file
455455

456456
open my $fh, "<", $file or return;
457457
while ( <$fh> ) {
458+
chomp;
458459
if (may_leak_address($_)) {
459-
print $file . ': ' . $_;
460+
printf("$file: $_\n");
460461
}
461462
}
462463
close $fh;

0 commit comments

Comments
 (0)