Re: [PATCH v3] scripts: add leaking_addresses.pl

2017-11-08 Thread Peter Zijlstra
On Tue, Nov 07, 2017 at 05:44:13PM -0500, Steven Rostedt wrote: > On Tue, 7 Nov 2017 13:44:01 -0800 > Linus Torvalds wrote: > > > > Looking other places that stand out, it seems like > > > /proc/lockdep_chains and /proc/lockdep (CONFIG_LOCKDEP=y) has a ton of > > > %p usage. It's unclear to me if

Re: [PATCH v3] scripts: add leaking_addresses.pl

2017-11-07 Thread Tobin C. Harding
On Tue, Nov 07, 2017 at 01:22:13PM -0800, Kees Cook wrote: > On Mon, Nov 6, 2017 at 9:27 AM, Linus Torvalds > wrote: [snip] > And for my kernels, I needed to exclude usbmon or the script would > hang (perhaps add a read timeout to the script to detect stalling > files?) Bother. I submitted the pa

Re: [PATCH v3] scripts: add leaking_addresses.pl

2017-11-07 Thread Tobin C. Harding
On Mon, Nov 06, 2017 at 09:27:09AM -0800, Linus Torvalds wrote: > On Sun, Nov 5, 2017 at 9:19 PM, Tobin C. Harding wrote: > > 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 a

Re: [PATCH v3] scripts: add leaking_addresses.pl

2017-11-07 Thread Tobin C. Harding
On Tue, Nov 07, 2017 at 01:44:01PM -0800, Linus Torvalds wrote: > On Tue, Nov 7, 2017 at 1:22 PM, Kees Cook wrote: > > > > Linus, what do you have in mind for the root-only "yes we really need > > the actual address output" exceptions? > > I am convinced that absolutely none of them should use '%

Re: [PATCH v3] scripts: add leaking_addresses.pl

2017-11-07 Thread Tobin C. Harding
Hi Kees, It seems I over looked your suggestions when submitting v4. My mistake. On Tue, Nov 07, 2017 at 01:22:13PM -0800, Kees Cook wrote: > On Mon, Nov 6, 2017 at 9:27 AM, Linus Torvalds > wrote: > > On Sun, Nov 5, 2017 at 9:19 PM, Tobin C. Harding wrote: > >> Currently we are leaking address

Re: [PATCH v3] scripts: add leaking_addresses.pl

2017-11-07 Thread Steven Rostedt
On Tue, 7 Nov 2017 13:44:01 -0800 Linus Torvalds wrote: > > Looking other places that stand out, it seems like > > /proc/lockdep_chains and /proc/lockdep (CONFIG_LOCKDEP=y) has a ton of > > %p usage. It's unclear to me if a hash is sufficient for meaningful > > debugging there? > > Maybe not,

Re: [PATCH v3] scripts: add leaking_addresses.pl

2017-11-07 Thread Kees Cook
On Tue, Nov 7, 2017 at 1:44 PM, Linus Torvalds wrote: > On Tue, Nov 7, 2017 at 1:22 PM, Kees Cook wrote: >> >> Linus, what do you have in mind for the root-only "yes we really need >> the actual address output" exceptions? > > I am convinced that absolutely none of them should use '%pK'. > > So f

Re: [PATCH v3] scripts: add leaking_addresses.pl

2017-11-07 Thread Linus Torvalds
On Tue, Nov 7, 2017 at 1:22 PM, Kees Cook wrote: > > Linus, what do you have in mind for the root-only "yes we really need > the actual address output" exceptions? I am convinced that absolutely none of them should use '%pK'. So far we have actually never seen a valid case wher %pK was really th

Re: [PATCH v3] scripts: add leaking_addresses.pl

2017-11-07 Thread Kees Cook
On Mon, Nov 6, 2017 at 9:27 AM, Linus Torvalds wrote: > On Sun, Nov 5, 2017 at 9:19 PM, Tobin C. Harding wrote: >> 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 file

Re: [PATCH v3] scripts: add leaking_addresses.pl

2017-11-06 Thread Tobin C. Harding
On Mon, Nov 06, 2017 at 09:41:09AM -0800, Linus Torvalds wrote: > On Mon, Nov 6, 2017 at 9:27 AM, Linus Torvalds > wrote: > > > > Lovely. This is great. It shows just how much totally pointless stuff > > we leak, and to normal users that really shouldn't need it. > > Side note: it would be good t

Re: [kernel-hardening] Re: [PATCH v3] scripts: add leaking_addresses.pl

2017-11-06 Thread Tobin C. Harding
On Mon, Nov 06, 2017 at 09:25:33PM +0300, Pavel Vasilyev wrote: >  ./leaking_addresses.pl --dont_walk_abs /proc --dont_walk_abs /sys > Unknown option: dont_walk_abs > Unknown option: dont_walk_abs Oh thanks. Documentation is out of sync with the code, what are the odds. v4 to come. thanks, Tobin

Re: [kernel-hardening] Re: [PATCH v3] scripts: add leaking_addresses.pl

2017-11-06 Thread Pavel Vasilyev
 ./leaking_addresses.pl --dont_walk_abs /proc --dont_walk_abs /sys Unknown option: dont_walk_abs Unknown option: dont_walk_abs 06.11.2017 20:27, Linus Torvalds пишет: > David - you can see the patch on patchwork: > >     https://patchwork.kernel.org/patch/10042605/ > > and try it out yourself. >

Re: [PATCH v3] scripts: add leaking_addresses.pl

2017-11-06 Thread Linus Torvalds
On Mon, Nov 6, 2017 at 9:27 AM, Linus Torvalds wrote: > > Lovely. This is great. It shows just how much totally pointless stuff > we leak, and to normal users that really shouldn't need it. Side note: it would be good to have some summary view, and perhaps some way to limit duplicates. I ended u

Re: [PATCH v3] scripts: add leaking_addresses.pl

2017-11-06 Thread Linus Torvalds
On Sun, Nov 5, 2017 at 9:19 PM, Tobin C. Harding wrote: > 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. Lovely