All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kaiwan N Billimoria <kaiwan.billimoria@gmail.com>
To: Alexander Kapshuk <alexander.kapshuk@gmail.com>
Cc: "Tobin C. Harding" <me@tobin.cc>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	kernel-hardening@lists.openwall.com
Subject: Re: [PATCH] leaking_addresses: add support for 32-bit kernel addresses
Date: Mon, 4 Dec 2017 19:38:58 +0530	[thread overview]
Message-ID: <CAPDLWs_iB+z9SyE0_OeZiOkqOn1b1fDBN07evcx8WvNgCKU+dg@mail.gmail.com> (raw)
In-Reply-To: <CAJ1xhMUQXEzjrCyMd9qdu5dm00Ash8d0C7n8Y9JHRg+THW-Q_w@mail.gmail.com>

Sure, thanks Alexander..
Tobin, request you to pl make the change while merging, thanks..


Thanks & Regards,
Kaiwan.


On Mon, Dec 4, 2017 at 6:07 PM, Alexander Kapshuk
<alexander.kapshuk@gmail.com> wrote:
> On Mon, Dec 4, 2017 at 12:20 PM,  <kaiwan.billimoria@gmail.com> wrote:
>> On Mon, 2017-12-04 at 19:21 +1100, Tobin C. Harding wrote:
>>> On Mon, Dec 04, 2017 at 10:51:53AM +0530, Kaiwan N Billimoria wrote:
>>> > > ---
>>> > diff --git a/scripts/leaking_addresses.pl b/scripts/leaking_addresses.pl
>>> > index 9906dcf8b807..260b52e456f1 100755
>>> > --- a/scripts/leaking_addresses.pl
>>> > +++ b/scripts/leaking_addresses.pl
>>> > @@ -266,7 +266,7 @@ sub is_false_positive
>>> >  sub is_false_positive_ix86_32
>>> >  {
>>> >         my ($match) = @_;
>>> > -       state $page_offset = eval get_page_offset(); # only gets called once
>>> > +       state $page_offset = hex get_page_offset(); # only gets called once
>>>
>>> I don't think this is valid ;) I meant use hex() to convert the string
>>> to an int so it doesn't throw the warning (inside get_page_offset()).
>>
>> Yup, got it, thanks   :-p
>> Combined patch below:
>>
>>
>> ---
>>  scripts/leaking_addresses.pl | 13 ++++++-------
>>  1 file changed, 6 insertions(+), 7 deletions(-)
>>
>> diff --git a/scripts/leaking_addresses.pl b/scripts/leaking_addresses.pl
>> index 9906dcf8b807..a595a2c66b12 100755
>> --- a/scripts/leaking_addresses.pl
>> +++ b/scripts/leaking_addresses.pl
>> @@ -266,8 +266,7 @@ sub is_false_positive
>>  sub is_false_positive_ix86_32
>>  {
>>         my ($match) = @_;
>> -       state $page_offset = eval get_page_offset(); # only gets called once
>> -
>> +       state $page_offset = get_page_offset(); # only gets called once
>>         if ($match =~ '\b(0x)?(f|F){8}\b') {
>>                 return 1;
>>         }
>> @@ -283,7 +282,7 @@ sub is_false_positive_ix86_32
>>  sub get_page_offset
>>  {
>>         my $page_offset;
>> -       my $default_offset = "0xc0000000";
>> +       my $default_offset = hex("0xc0000000");
>>         my @config_files;
>>
>>         # Allow --page-offset-32bit to override.
>> @@ -306,23 +305,23 @@ sub get_page_offset
>>                 } else {
>>                         $page_offset = parse_kernel_config_file($tmp_file);
>>                         if ($page_offset ne "") {
>> -                               return $page_offset;
>> +                               return hex($page_offset);
>>                         }
>>                 }
>>                 system("rm -f $tmp_file");
>>         }
>>
>>         foreach my $config_file (@config_files) {
>> -               $config_file =~ s/\R*//g;
>> +               chomp $config_file;
>>                 $page_offset = parse_kernel_config_file($config_file);
>>                 if ($page_offset ne "") {
>> -                       return $page_offset;
>> +                       return hex($page_offset);
>>                 }
>>         }
>>
>>         printf STDERR "\nFailed to parse kernel config files\n";
>>         printf STDERR "*** NOTE ***\n";
>> -       printf STDERR "Falling back to PAGE_OFFSET = %s\n\n", $default_offset;
>> +       printf STDERR "Falling back to PAGE_OFFSET = 0x%x\n\n", $default_offset;
>
> Better use the '#' flag with the 'x' conversion specifier:
> perl -e 'my $default_offset = hex("0xc0000000");printf "%#x\n", $default_offset'
> 0xc0000000
>
>>
>>         return $default_offset;
>>  }
>> --
>> 2.14.3
>>
>> Thanks,
>> Kaiwan.
>>
>>> thanks,
>>> Tobin.

WARNING: multiple messages have this Message-ID (diff)
From: Kaiwan N Billimoria <kaiwan.billimoria@gmail.com>
To: Alexander Kapshuk <alexander.kapshuk@gmail.com>
Cc: "Tobin C. Harding" <me@tobin.cc>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	kernel-hardening@lists.openwall.com
Subject: [kernel-hardening] Re: [PATCH] leaking_addresses: add support for 32-bit kernel addresses
Date: Mon, 4 Dec 2017 19:38:58 +0530	[thread overview]
Message-ID: <CAPDLWs_iB+z9SyE0_OeZiOkqOn1b1fDBN07evcx8WvNgCKU+dg@mail.gmail.com> (raw)
In-Reply-To: <CAJ1xhMUQXEzjrCyMd9qdu5dm00Ash8d0C7n8Y9JHRg+THW-Q_w@mail.gmail.com>

Sure, thanks Alexander..
Tobin, request you to pl make the change while merging, thanks..


Thanks & Regards,
Kaiwan.


On Mon, Dec 4, 2017 at 6:07 PM, Alexander Kapshuk
<alexander.kapshuk@gmail.com> wrote:
> On Mon, Dec 4, 2017 at 12:20 PM,  <kaiwan.billimoria@gmail.com> wrote:
>> On Mon, 2017-12-04 at 19:21 +1100, Tobin C. Harding wrote:
>>> On Mon, Dec 04, 2017 at 10:51:53AM +0530, Kaiwan N Billimoria wrote:
>>> > > ---
>>> > diff --git a/scripts/leaking_addresses.pl b/scripts/leaking_addresses.pl
>>> > index 9906dcf8b807..260b52e456f1 100755
>>> > --- a/scripts/leaking_addresses.pl
>>> > +++ b/scripts/leaking_addresses.pl
>>> > @@ -266,7 +266,7 @@ sub is_false_positive
>>> >  sub is_false_positive_ix86_32
>>> >  {
>>> >         my ($match) = @_;
>>> > -       state $page_offset = eval get_page_offset(); # only gets called once
>>> > +       state $page_offset = hex get_page_offset(); # only gets called once
>>>
>>> I don't think this is valid ;) I meant use hex() to convert the string
>>> to an int so it doesn't throw the warning (inside get_page_offset()).
>>
>> Yup, got it, thanks   :-p
>> Combined patch below:
>>
>>
>> ---
>>  scripts/leaking_addresses.pl | 13 ++++++-------
>>  1 file changed, 6 insertions(+), 7 deletions(-)
>>
>> diff --git a/scripts/leaking_addresses.pl b/scripts/leaking_addresses.pl
>> index 9906dcf8b807..a595a2c66b12 100755
>> --- a/scripts/leaking_addresses.pl
>> +++ b/scripts/leaking_addresses.pl
>> @@ -266,8 +266,7 @@ sub is_false_positive
>>  sub is_false_positive_ix86_32
>>  {
>>         my ($match) = @_;
>> -       state $page_offset = eval get_page_offset(); # only gets called once
>> -
>> +       state $page_offset = get_page_offset(); # only gets called once
>>         if ($match =~ '\b(0x)?(f|F){8}\b') {
>>                 return 1;
>>         }
>> @@ -283,7 +282,7 @@ sub is_false_positive_ix86_32
>>  sub get_page_offset
>>  {
>>         my $page_offset;
>> -       my $default_offset = "0xc0000000";
>> +       my $default_offset = hex("0xc0000000");
>>         my @config_files;
>>
>>         # Allow --page-offset-32bit to override.
>> @@ -306,23 +305,23 @@ sub get_page_offset
>>                 } else {
>>                         $page_offset = parse_kernel_config_file($tmp_file);
>>                         if ($page_offset ne "") {
>> -                               return $page_offset;
>> +                               return hex($page_offset);
>>                         }
>>                 }
>>                 system("rm -f $tmp_file");
>>         }
>>
>>         foreach my $config_file (@config_files) {
>> -               $config_file =~ s/\R*//g;
>> +               chomp $config_file;
>>                 $page_offset = parse_kernel_config_file($config_file);
>>                 if ($page_offset ne "") {
>> -                       return $page_offset;
>> +                       return hex($page_offset);
>>                 }
>>         }
>>
>>         printf STDERR "\nFailed to parse kernel config files\n";
>>         printf STDERR "*** NOTE ***\n";
>> -       printf STDERR "Falling back to PAGE_OFFSET = %s\n\n", $default_offset;
>> +       printf STDERR "Falling back to PAGE_OFFSET = 0x%x\n\n", $default_offset;
>
> Better use the '#' flag with the 'x' conversion specifier:
> perl -e 'my $default_offset = hex("0xc0000000");printf "%#x\n", $default_offset'
> 0xc0000000
>
>>
>>         return $default_offset;
>>  }
>> --
>> 2.14.3
>>
>> Thanks,
>> Kaiwan.
>>
>>> thanks,
>>> Tobin.

  parent reply	other threads:[~2017-12-04 14:09 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-28  6:32 [PATCH] leaking_addresses: add support for 32-bit kernel addresses Tobin C. Harding
2017-11-28  6:32 ` [kernel-hardening] " Tobin C. Harding
2017-11-28 13:16 ` Alexander Kapshuk
2017-11-28 13:16   ` [kernel-hardening] " Alexander Kapshuk
2017-11-28 21:10   ` Tobin C. Harding
2017-11-28 21:10     ` [kernel-hardening] " Tobin C. Harding
2017-11-29  7:59     ` Alexander Kapshuk
2017-11-29  7:59       ` [kernel-hardening] " Alexander Kapshuk
2017-11-29 10:16       ` Tobin C. Harding
2017-11-29 10:16         ` [kernel-hardening] " Tobin C. Harding
2017-11-29 11:02         ` Kaiwan N Billimoria
2017-11-29 11:02           ` [kernel-hardening] " Kaiwan N Billimoria
2017-11-29 20:48           ` Tobin C. Harding
2017-11-29 20:48             ` [kernel-hardening] " Tobin C. Harding
2017-12-01 13:03             ` Kaiwan N Billimoria
2017-12-01 13:03               ` [kernel-hardening] " Kaiwan N Billimoria
2017-12-01 13:09             ` kaiwan.billimoria
2017-12-01 13:09               ` [kernel-hardening] " kaiwan.billimoria
2017-12-04  0:11               ` Tobin C. Harding
2017-12-04  0:11                 ` [kernel-hardening] " Tobin C. Harding
2017-12-04  4:41                 ` kaiwan.billimoria
2017-12-04  4:41                   ` [kernel-hardening] " kaiwan.billimoria
2017-12-04  4:55                   ` Tobin C. Harding
2017-12-04  4:55                     ` [kernel-hardening] " Tobin C. Harding
2017-12-04  5:09                     ` Kaiwan N Billimoria
2017-12-04  5:09                       ` [kernel-hardening] " Kaiwan N Billimoria
2017-12-04  5:21                       ` Kaiwan N Billimoria
2017-12-04  5:21                         ` [kernel-hardening] " Kaiwan N Billimoria
2017-12-04  8:21                         ` Tobin C. Harding
2017-12-04  8:21                           ` [kernel-hardening] " Tobin C. Harding
2017-12-04 10:20                           ` kaiwan.billimoria
2017-12-04 10:20                             ` [kernel-hardening] " kaiwan.billimoria
2017-12-04 12:37                             ` Alexander Kapshuk
2017-12-04 12:37                               ` [kernel-hardening] " Alexander Kapshuk
2017-12-04 13:28                               ` Kaiwan N Billimoria
2017-12-04 14:08                               ` Kaiwan N Billimoria [this message]
2017-12-04 14:08                                 ` Kaiwan N Billimoria
2017-12-04 20:59                             ` Tobin C. Harding
2017-12-04 20:59                               ` [kernel-hardening] " Tobin C. Harding
2017-11-29 11:30         ` Alexander Kapshuk
2017-11-29 11:30           ` [kernel-hardening] " Alexander Kapshuk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAPDLWs_iB+z9SyE0_OeZiOkqOn1b1fDBN07evcx8WvNgCKU+dg@mail.gmail.com \
    --to=kaiwan.billimoria@gmail.com \
    --cc=alexander.kapshuk@gmail.com \
    --cc=kernel-hardening@lists.openwall.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=me@tobin.cc \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.