lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAGXu5jKd4Hpn8Df2mY9up+STU4b7hAbO+NC4XNS1ZfVopjWiiA@mail.gmail.com>
Date:   Fri, 20 Oct 2017 07:12:29 -0700
From:   Kees Cook <keescook@...omium.org>
To:     Michal Hocko <mhocko@...nel.org>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        Jiri Kosina <jkosina@...e.cz>,
        Al Viro <viro@...iv.linux.org.uk>,
        Oleg Nesterov <oleg@...hat.com>,
        Ingo Molnar <mingo@...hat.com>, Baoquan He <bhe@...hat.com>
Subject: Re: [PATCH 2/2] fs, elf: drop MAP_FIXED from initial ET_DYN segment

On Fri, Oct 20, 2017 at 1:45 AM, Michal Hocko <mhocko@...nel.org> wrote:
> On Thu 19-10-17 10:19:40, Kees Cook wrote:
>> On Thu, Oct 19, 2017 at 4:20 AM, Michal Hocko <mhocko@...nel.org> wrote:
>> > On Tue 17-10-17 13:01:04, Kees Cook wrote:
>> >> On Tue, Oct 17, 2017 at 2:04 AM, Michal Hocko <mhocko@...nel.org> wrote:
>> > [...]
>> >> > I am not insisting on this patch but it seems to me is just makes a
>> >> > recoverable state a failure.
>> >>
>> >> Right, I understand you're trying to make it recoverable. I'm
>> >> suggesting that making it recoverable provides a way for an attack to
>> >> abuse it, and that what we'd be recovering from is a case we should
>> >> never ever see.
>> >>
>> >> Consider the case where through some future bug/feature, it's possible
>> >> to put the stack at an arbitrary location during an exec. (We've
>> >> worked to fix that already, but who knows what the future holds either
>> >> through misfeatures or bugs.) If an attacker maps the stack over a
>> >> large portion of the PIE exec range, patch 2 will result in vmmap
>> >> searching out a location that isn't already allocated. This means that
>> >> instead of the PIE ASLR choosing from the entire possible range, it
>> >> will get limited to only the area where something isn't already
>> >> overlapping. This would give an attacker the ability to control the
>> >> PIE ASLR, possibly forcing it into a fixed location.
>> >
>> > Yes, I guess I understand that part. What is not clear to me exactly is
>> > why this matters as we have the mmap_base randomized and not under the
>> > control of the attacker.
>>
>> mmap_base is separate from the PIE base, so patch 2 would allow for a
>> reduction of the PIE ASLR entropy in the case of a novel overlap
>> attack.
>
> OK, it seems that I am just too dull see through your concerns here.

I'm probably not explaining it well enough! :(

> Anyway, are you willing to ack the patch 1 (when metag fix is included)?
> I would resubmit in that case and ask for merging without patch 2.

Yup, I really like patch 1: it protects us from "impossible"
situations, which we know rarely stay impossible. :)

-Kees

-- 
Kees Cook
Pixel Security

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ