From: Tycho Andersen <tycho@tycho.ws>
To: "Tobin C. Harding" <me@tobin.cc>
Cc: Kernel Hardening <kernel-hardening@lists.openwall.com>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] leaking_addresses: check if file name contains address
Date: Thu, 1 Mar 2018 17:13:49 -0700 [thread overview]
Message-ID: <20180302001349.buaus74hx3xjoaqs@cisco> (raw)
In-Reply-To: <1519941800-27710-3-git-send-email-me@tobin.cc>
On Fri, Mar 02, 2018 at 09:03:20AM +1100, Tobin C. Harding wrote:
> 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>
Acked-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
>
prev parent reply other threads:[~2018-03-02 0:13 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 ` [PATCH 2/2] leaking_addresses: check if file name contains address Tobin C. Harding
2018-03-02 0:13 ` Tycho Andersen [this message]
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=20180302001349.buaus74hx3xjoaqs@cisco \
--to=tycho@tycho.ws \
--cc=kernel-hardening@lists.openwall.com \
--cc=linux-kernel@vger.kernel.org \
--cc=me@tobin.cc \
/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®