]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit - scripts/leaking_addresses.pl
leaking_addresses: add 32-bit support
authorTobin C. Harding <me@tobin.cc>
Mon, 29 Jan 2018 04:00:16 +0000 (15:00 +1100)
committerTobin C. Harding <me@tobin.cc>
Fri, 6 Apr 2018 22:50:34 +0000 (08:50 +1000)
commit1410fe4eea22959bd31c05e4c1846f1718300bde
tree28b82ea47ec50a4eb718119206301e95128c419b
parent5eb0da0568a241f72732eb2143538fb14879a52c
leaking_addresses: add 32-bit support

Currently script only supports x86_64 and ppc64.  It would be nice to be
able to scan 32-bit machines also.  We can add support for 32-bit
architectures by modifying how we check for false positives, taking
advantage of the page offset used by the kernel, and using the correct
regular expression.

Support for 32-bit machines is enabled by the observation that the kernel
addresses on 32-bit machines are larger [in value] than the page offset.
We can use this to filter false positives when scanning the kernel for
leaking addresses.

Programmatic determination of the running architecture is not
immediately obvious (current 32-bit machines return various strings from
`uname -m`).  We therefore provide a flag to enable scanning of 32-bit
kernels.  Also we can check the kernel config file for the offset and if
not found default to 0xc0000000.  A command line option to parse in the
page offset is also provided.  We do automatically detect architecture
if running on ix86.

Add support for 32-bit kernels.  Add a command line option for page
offset.

Suggested-by: Kaiwan N Billimoria <kaiwan.billimoria@gmail.com>
Signed-off-by: Tobin C. Harding <me@tobin.cc>
scripts/leaking_addresses.pl