Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 08 Nov 2017 23:10:56 +1100
From: Michael Ellerman <>
To: "Tobin C. Harding" <>,
Cc: "Tobin C. Harding" <>, "Jason A. Donenfeld" <>, Theodore Ts'o <>, Linus Torvalds <>, Kees Cook <>, Paolo Bonzini <>, Tycho Andersen <>, "Roberts\, William C" <>, Tejun Heo <>, Jordan Glover <>, Greg KH <>, Petr Mladek <>, Joe Perches <>, Ian Campbell <>, Sergey Senozhatsky <>, Catalin Marinas <>, Will Deacon <>, Steven Rostedt <>, Chris Fries <>, Dave Weinstein <>, Daniel Micay <>, Djalal Harouni <>,, Network Development <>, David Miller <>
Subject: Re: [PATCH v4] scripts: add

"Tobin C. Harding" <> writes:
> Currently we are leaking addresses from the kernel to user space. This
> script is an attempt to find some of those leakages. Script parses
> `dmesg` output and /proc and /sys files for hex strings that look like
> kernel addresses.
> Only works for 64 bit kernels, the reason being that kernel addresses
> on 64 bit kernels have 'ffff' as the leading bit pattern making greping
> possible.

That doesn't work super well on other architectures :D

I don't speak perl but presumably you can check the arch somehow and
customise the regex?

> +# Return _all_ non false positive addresses from $line.
> +sub extract_addresses
> +{
> +        my ($line) = @_;
> +        my $address = '\b(0x)?ffff[[:xdigit:]]{12}\b';

On 64-bit powerpc (ppc64/ppc64le) we'd want:

+        my $address = '\b(0x)?[89abcdef]00[[:xdigit:]]{13}\b';

> +# Do not parse these files (absolute path).
> +my @skip_parse_files_abs = ('/proc/kmsg',
> +			    '/proc/kcore',
> +			    '/proc/fs/ext4/sdb1/mb_groups',
> +			    '/proc/1/fd/3',
> +			    '/sys/kernel/debug/tracing/trace_pipe',
> +			    '/sys/kernel/security/apparmor/revision');

Can you add:


and/or /proc/device-tree (which is a symlink to the above).

We should also start restricting access to that because it may have
potentially interesting physical addresses in it, but that will break
existing tools, so it will need to be opt-in and done over time.


Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.