Date: Sun, 28 May 2017 14:32:24 -0700 From: Kees Cook <keescook@...gle.com> To: Boris Lukashev <blukashev@...pervictus.com> Cc: Igor Stoppa <igor.stoppa@...wei.com>, Casey Schaufler <casey@...aufler-ca.com>, Michal Hocko <mhocko@...nel.org>, Dave Hansen <dave.hansen@...el.com>, Laura Abbott <labbott@...hat.com>, Linux-MM <linux-mm@...ck.org>, "kernel-hardening@...ts.openwall.com" <kernel-hardening@...ts.openwall.com>, LKML <linux-kernel@...r.kernel.org>, Daniel Micay <danielmicay@...il.com>, Greg KH <gregkh@...uxfoundation.org>, James Morris <james.l.morris@...cle.com>, Stephen Smalley <sds@...ho.nsa.gov> Subject: Re: Re: [PATCH 1/1] Sealable memory support On Sun, May 28, 2017 at 11:56 AM, Boris Lukashev <blukashev@...pervictus.com> wrote: > So what about a middle ground where CoW semantics are used to enforce > the state of these allocations as RO, but provide a strictly > controlled pathway to read the RO data, copy and modify it, then write > and seal into a new allocation. Successful return from this process > should permit the page table to change the pointer to where the object > now resides, and initiate freeing of the original memory so long as a > refcount is kept for accesses. That way, sealable memory is sealed, > and any consumers reading it will be using the original ptr to the > original smalloc region. Attackers who do manage to change the This could be another way to do it, yeah, and it helps that smalloc() is built on vmalloc(). It'd require some careful design, but it could be a way forward after this initial sealed-after-init version goes in. > Lastly, my meager understanding is that PAX set the entire kernel as > RO, and implemented writeable access via pax_open/close. How were they > fighting against race conditions, and what is the benefit of specific > regions being allocated this way as opposed to the RO-all-the-things > approach which makes writes a specialized set of operations? My understanding is that PaX's KERNEXEC with the constification plugin moves a substantial portion of the kernel's .data section (effectively) into the .rodata section. It's not the "entire" kernel. (Well, depending on how you count. The .text section is already read-only upstream.) PaX, as far as I know, provided no dynamic memory allocation protections, like smalloc() would provide. -Kees -- Kees Cook Pixel Security
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.