<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/scripts/leaking_addresses.pl, branch v5.17-rc6</title>
<subtitle>Linux Kernel (branches are rebased on master from time to time)</subtitle>
<id>https://sre.ring0.de/linux/atom?h=v5.17-rc6</id>
<link rel='self' href='https://sre.ring0.de/linux/atom?h=v5.17-rc6'/>
<link rel='alternate' type='text/html' href='https://sre.ring0.de/linux/'/>
<updated>2021-10-15T09:25:13Z</updated>
<entry>
<title>leaking_addresses: Always print a trailing newline</title>
<updated>2021-10-15T09:25:13Z</updated>
<author>
<name>Kees Cook</name>
<email>keescook@chromium.org</email>
</author>
<published>2021-09-29T22:02:18Z</published>
<link rel='alternate' type='text/html' href='https://sre.ring0.de/linux/commit/?id=cf2a85efdade117e2169d6e26641016cbbf03ef0'/>
<id>urn:sha1:cf2a85efdade117e2169d6e26641016cbbf03ef0</id>
<content type='text'>
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 &lt;keescook@chromium.org&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Link: https://lkml.kernel.org/r/20211008111626.151570317@infradead.org
</content>
</entry>
<entry>
<title>treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 166</title>
<updated>2019-05-30T18:26:39Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2019-05-27T06:55:14Z</published>
<link rel='alternate' type='text/html' href='https://sre.ring0.de/linux/commit/?id=4f19048fd0a0036e02443237952db5bfa5b5cdf0'/>
<id>urn:sha1:4f19048fd0a0036e02443237952db5bfa5b5cdf0</id>
<content type='text'>
Based on 1 normalized pattern(s):

  licensed under the terms of the gnu gpl license version 2

extracted by the scancode license scanner the SPDX license identifier

  GPL-2.0-only

has been chosen to replace the boilerplate/reference in 62 file(s).

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Reviewed-by: Allison Randal &lt;allison@lohutok.net&gt;
Reviewed-by: Kate Stewart &lt;kstewart@linuxfoundation.org&gt;
Reviewed-by: Richard Fontana &lt;rfontana@redhat.com&gt;
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190527070033.929121379@linutronix.de
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>leaking_addresses: Completely remove --version flag</title>
<updated>2019-03-06T21:53:18Z</updated>
<author>
<name>Tobin C. Harding</name>
<email>tobin@kernel.org</email>
</author>
<published>2018-10-23T00:37:02Z</published>
<link rel='alternate' type='text/html' href='https://sre.ring0.de/linux/commit/?id=9ac060a708e054233265f8febfcef009ac3da826'/>
<id>urn:sha1:9ac060a708e054233265f8febfcef009ac3da826</id>
<content type='text'>
Recently attempt to remove the '--version' flag was made, badly.  We
failed to remove mention of it from the help output.  And we (me) failed
to actually remove the flag from the options list.

_Completely_ remove --version flag.
</content>
</entry>
<entry>
<title>leaking_addresses: Fix calls to dprint</title>
<updated>2019-03-06T21:53:18Z</updated>
<author>
<name>Tobin C. Harding</name>
<email>tobin@kernel.org</email>
</author>
<published>2018-10-22T23:51:08Z</published>
<link rel='alternate' type='text/html' href='https://sre.ring0.de/linux/commit/?id=0f2994333315f004265571eab787474b73d72ed6'/>
<id>urn:sha1:0f2994333315f004265571eab787474b73d72ed6</id>
<content type='text'>
Currently calls to function dprint() are non uniform and at times
incorrect.

Use uniform _correct_ call to function dprint().

Signed-off-by: Tobin C. Harding &lt;tobin@kernel.org&gt;
</content>
</entry>
<entry>
<title>leaking_addresses: check if file name contains address</title>
<updated>2018-04-06T22:50:34Z</updated>
<author>
<name>Tobin C. Harding</name>
<email>me@tobin.cc</email>
</author>
<published>2018-03-01T21:49:55Z</published>
<link rel='alternate' type='text/html' href='https://sre.ring0.de/linux/commit/?id=c73dff595f259736a90f52b38cf5798abeae4a3c'/>
<id>urn:sha1:c73dff595f259736a90f52b38cf5798abeae4a3c</id>
<content type='text'>
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 &lt;tycho@tycho.ws&gt;
Acked-by: Tycho Andersen &lt;tycho@tycho.ws&gt;
Signed-off-by: Tobin C. Harding &lt;me@tobin.cc&gt;
</content>
</entry>
<entry>
<title>leaking_addresses: explicitly name variable used in regex</title>
<updated>2018-04-06T22:50:34Z</updated>
<author>
<name>Tobin C. Harding</name>
<email>me@tobin.cc</email>
</author>
<published>2018-03-01T21:42:59Z</published>
<link rel='alternate' type='text/html' href='https://sre.ring0.de/linux/commit/?id=2306a67745ebdf3f98bc954248b74a3f1d57cdc2'/>
<id>urn:sha1:2306a67745ebdf3f98bc954248b74a3f1d57cdc2</id>
<content type='text'>
Currently sub routine may_leak_address() is checking regex against Perl
special variable $_ which is _fortunately_ being set correctly in a loop
before this sub routine is called.  We already have declared a variable
to hold this value '$line' we should use it.

Use $line in regex match instead of implicit $_

Signed-off-by: Tobin C. Harding &lt;me@tobin.cc&gt;
</content>
</entry>
<entry>
<title>leaking_addresses: remove version number</title>
<updated>2018-04-06T22:50:34Z</updated>
<author>
<name>Tobin C. Harding</name>
<email>me@tobin.cc</email>
</author>
<published>2018-02-27T04:15:34Z</published>
<link rel='alternate' type='text/html' href='https://sre.ring0.de/linux/commit/?id=34827374492580b27c3cba29d493dab28c8c25d3'/>
<id>urn:sha1:34827374492580b27c3cba29d493dab28c8c25d3</id>
<content type='text'>
We have git now, we don't need a version number.  This was originally
added because leaking_addresses.pl shamelessly (and mindlessly) copied
checkpatch.pl

Remove version number from script.

Signed-off-by: Tobin C. Harding &lt;me@tobin.cc&gt;
</content>
</entry>
<entry>
<title>leaking_addresses: skip '/proc/1/syscall'</title>
<updated>2018-04-06T22:50:34Z</updated>
<author>
<name>Tobin C. Harding</name>
<email>me@tobin.cc</email>
</author>
<published>2018-02-27T03:14:24Z</published>
<link rel='alternate' type='text/html' href='https://sre.ring0.de/linux/commit/?id=2ad742939283ed0613be654ad0aaf29b797f9905'/>
<id>urn:sha1:2ad742939283ed0613be654ad0aaf29b797f9905</id>
<content type='text'>
The pointers listed in /proc/1/syscall are user pointers, and negative
syscall args will show up like kernel addresses.

For example

/proc/31808/syscall: 0 0x3 0x55b107a38180 0x2000 0xffffffffffffffb0 \
0x55b107a302d0 0x55b107a38180 0x7fffa313b8e8 0x7ff098560d11

Skip parsing /proc/1/syscall

Suggested-by: Tycho Andersen &lt;tycho@tycho.ws&gt;
Signed-off-by: Tobin C. Harding &lt;me@tobin.cc&gt;
</content>
</entry>
<entry>
<title>leaking_addresses: skip all /proc/PID except /proc/1</title>
<updated>2018-04-06T22:50:34Z</updated>
<author>
<name>Tobin C. Harding</name>
<email>me@tobin.cc</email>
</author>
<published>2018-02-27T04:02:57Z</published>
<link rel='alternate' type='text/html' href='https://sre.ring0.de/linux/commit/?id=472c9e1085f20de71fc482500c8f1e4e45dff651'/>
<id>urn:sha1:472c9e1085f20de71fc482500c8f1e4e45dff651</id>
<content type='text'>
When the system is idle it is likely that most files under /proc/PID
will be identical for various processes.  Scanning _all_ the PIDs under
/proc is unnecessary and implies that we are thoroughly scanning /proc.
This is _not_ the case because there may be ways userspace can trigger
creation of /proc files that leak addresses but were not present during
a scan.  For these two reasons we should exclude all PID directories
under /proc except '1/'

Exclude all /proc/PID except /proc/1.

Signed-off-by: Tobin C. Harding &lt;me@tobin.cc&gt;
</content>
</entry>
<entry>
<title>leaking_addresses: cache architecture name</title>
<updated>2018-04-06T22:50:34Z</updated>
<author>
<name>Tobin C. Harding</name>
<email>me@tobin.cc</email>
</author>
<published>2018-02-19T02:23:44Z</published>
<link rel='alternate' type='text/html' href='https://sre.ring0.de/linux/commit/?id=5e4bac34edc7829b4a0749e3870d4a171c1f036f'/>
<id>urn:sha1:5e4bac34edc7829b4a0749e3870d4a171c1f036f</id>
<content type='text'>
Currently we are repeatedly calling `uname -m`.  This is causing the
script to take a long time to run (more than 10 seconds to parse
/proc/kallsyms).  We can use Perl state variables to cache the result of
the first call to `uname -m`.  With this change in place the script
scans the whole kernel in under a minute.

Cache machine architecture in state variable.

Signed-off-by: Tobin C. Harding &lt;me@tobin.cc&gt;
</content>
</entry>
</feed>
