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] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 16 Nov 2016 10:50:52 +1100
From:   Michael Ellerman <mpe@...erman.id.au>
To:     Kees Cook <keescook@...omium.org>
Cc:     Andrew Morton <akpm@...ux-foundation.org>,
        Christoph Lameter <cl@...ux.com>,
        Pekka Enberg <penberg@...nel.org>,
        David Rientjes <rientjes@...gle.com>,
        Joonsoo Kim <iamjoonsoo.kim@....com>,
        Linux-MM <linux-mm@...ck.org>,
        LKML <linux-kernel@...r.kernel.org>,
        "kernel-hardening\@lists.openwall.com" 
        <kernel-hardening@...ts.openwall.com>
Subject: Re: [kernel-hardening] Re: [PATCH] slab: Add POISON_POINTER_DELTA to ZERO_SIZE_PTR

Kees Cook <keescook@...omium.org> writes:

> On Tue, Nov 15, 2016 at 2:57 AM, Michael Ellerman <mpe@...erman.id.au> wrote:
>> POISON_POINTER_DELTA is defined in poison.h, and is intended to be used
>> to shift poison values so that they don't alias userspace.
>>
>> We should add it to ZERO_SIZE_PTR so that attackers can't use
>> ZERO_SIZE_PTR as a way to get a pointer to userspace.
>
> Ah, when dealing with a 0-sized malloc or similar?

Yeah as returned by a 0-sized kmalloc for example.

> Do you have pointers to exploits that rely on this?

Not real ones, it was used in the StringIPC challenge:

https://poppopret.org/2015/11/16/csaw-ctf-2015-kernel-exploitation-challenge/

Though that included the ability to seek to an arbitrary offset from the
zero size pointer, so this wouldn't have helped.

> Regardless, normally PAN/SMAP-like things should be sufficient to
> protect against this.

True. Not everyone has PAN/SMAP though :)

> Additionally, on everything but x86_64 and arm64, POISON_POINTER_DELTA
> == 0, if I'm reading correctly:

You are reading correctly. All 64-bit arches should be able to define it
to something though.

> Is the plan to add ILLEGAL_POINTER_VALUE for powerpc too?

Yep. I should have CC'ed you on the patch :)

> And either way, this patch, IIUC, will break the ZERO_OR_NULL_PTR()
> check, since suddenly all of userspace will match it. (Though maybe
> that's okay?)

Yeah I wasn't sure what to do with that.

I don't think it breaks it, but it does become a bit fishy because as
you say all of userspace (and more) will now match.

It should probably just become two separate tests, though that
potentially has issues with double evaluation of the argument. AFAICS
none of the callers pass an expression though.

cheers

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ