From: "Tobin C. Harding" <me@tobin.cc>
To: Kernel Hardening <kernel-hardening@lists.openwall.com>
Cc: "Tobin C. Harding" <me@tobin.cc>, Tycho Andersen <tycho@tycho.ws>,
LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH 2/2] leaking_addresses: check if file name contains address
Date: Fri, 2 Mar 2018 09:03:20 +1100 [thread overview]
Message-ID: <1519941800-27710-3-git-send-email-me@tobin.cc> (raw)
In-Reply-To: <1519941800-27710-1-git-send-email-me@tobin.cc>
Sometimes files may be created by using output from printk. As the scan
traverses the directory tree we should parse each path name and check if
it is leaking an address.
Add check for leaking address on each path name.
Suggested-by: Tycho Andersen <tycho@tycho.ws>
Signed-off-by: Tobin C. Harding <me@tobin.cc>
---
scripts/leaking_addresses.pl | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/scripts/leaking_addresses.pl b/scripts/leaking_addresses.pl
index 65a65aa64d26..a550c9bc34f5 100755
--- a/scripts/leaking_addresses.pl
+++ b/scripts/leaking_addresses.pl
@@ -463,6 +463,16 @@ sub parse_file
close $fh;
}
+# Checks if the actual path name is leaking a kernel address.
+sub check_path_for_leaks
+{
+ my ($path) = @_;
+
+ if (may_leak_address($path)) {
+ printf("Path name may contain address: $path\n");
+ }
+}
+
# Recursively walk directory tree.
sub walk
{
@@ -484,6 +494,8 @@ sub walk
next if (skip($path));
+ check_path_for_leaks($path);
+
if (-d $path) {
push @dirs, $path;
next;
--
2.7.4
next prev parent reply other threads:[~2018-03-01 22:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-01 22:03 [PATCH 0/2] leaking_addresses: check path name for leaks Tobin C. Harding
2018-03-01 22:03 ` [PATCH 1/2] leaking_addresses: explicitly name variable used in regex Tobin C. Harding
2018-03-01 22:03 ` Tobin C. Harding [this message]
2018-03-02 0:13 ` [PATCH 2/2] leaking_addresses: check if file name contains address Tycho Andersen
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=1519941800-27710-3-git-send-email-me@tobin.cc \
--to=me@tobin.cc \
--cc=kernel-hardening@lists.openwall.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tycho@tycho.ws \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®