Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 04 Dec 2017 10:11:21 +0530
From: kaiwan.billimoria@...il.com
To: "Tobin C. Harding" <me@...in.cc>
Cc: Alexander Kapshuk <alexander.kapshuk@...il.com>, linux-kernel
	 <linux-kernel@...r.kernel.org>, kernel-hardening@...ts.openwall.com
Subject: Re: [PATCH] leaking_addresses: add support for 32-bit kernel
 addresses

On Mon, 2017-12-04 at 11:11 +1100, Tobin C. Harding wrote:
> On Fri, Dec 01, 2017 at 06:39:07PM +0530, kaiwan.billimoria@...il.com wrote:

> > @@ -267,7 +266,7 @@ sub is_false_positive
> >  sub is_false_positive_ix86_32
> >  {
> >  	my ($match) = @_;
> > -	state $page_offset = get_page_offset(); # only gets called once
> > +	state $page_offset = eval get_page_offset(); # only gets called once
> 
> Why do you use 'eval' here?
> 
Without the eval:
i.e.
  state $page_offset = get_page_offset(); # only gets called once

$ ./leaking_addresses.pl  |head -200
Argument "0x80000000" isn't numeric in numeric lt (<) at ./leaking_addresses.pl line 277.
...

With the 'eval', no warning, it's fine.


Additional Comments:

a) When running in debug mode, print the arch we're currently running on
b) Also, while checking, I found another bug; requires the fix below (strip the filename of LF).

Patch follows:

---
diff --git a/scripts/leaking_addresses.pl b/scripts/leaking_addresses.pl
index 3a8691a642c8..9906dcf8b807 100755
--- a/scripts/leaking_addresses.pl
+++ b/scripts/leaking_addresses.pl
@@ -158,8 +158,8 @@ if (!$input_raw and ($squash_by_path or $squash_by_filename)) {
        exit(128);
 }
 
+show_detected_architecture() if $debug;
 if (!is_supported_architecture()) {
-       show_detected_architecture() if $debug;
        printf "\nScript does not support your architecture, sorry.\n";
        printf "\nCurrently we support: \n\n";
        foreach(@...PORTED_ARCHITECTURES) {
@@ -313,6 +313,7 @@ sub get_page_offset
        }
 
        foreach my $config_file (@...fig_files) {
+               $config_file =~ s/\R*//g;
                $page_offset = parse_kernel_config_file($config_file);
                if ($page_offset ne "") {
                        return $page_offset;



Thanks,
Kaiwan.


> thanks,
> Tobin.

Powered by blists - more mailing lists

Your e-mail address:

Powered by Openwall GNU/*/Linux - Powered by OpenVZ