Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sun, 10 Jul 2016 01:16:36 +0200
From: "PaX Team" <>
To: Kees Cook <>, Andy Lutomirski <>
CC: Christoph Lameter <>,
        Andrew Morton <>,
        Brad Spengler <>,
        Pekka Enberg <>,
        Ard Biesheuvel <>,
        Casey Schaufler <>,
        Will Deacon <>, Rik van Riel <>,
        Benjamin Herrenschmidt <>,
        Dmitry Vyukov <>,
        "" <>,
        "" <>,
        X86 ML <>, Catalin Marinas <>,
        linux-arch <>,
        David Rientjes <>,
        Mathias Krause <>,
        "" <>,
        "David S. Miller" <>,
        Laura Abbott <>,
        "" <>, Jan Kara <>,
        Russell King <>,
        Michael Ellerman <>,
        Andrea Arcangeli <>,
        Fenghua Yu <>,,
        Vitaly Wool <>,
        "" <>,
        Borislav Petkov <>, Tony Luck <>,
        Joonsoo Kim <>,
Subject: Re: [PATCH 0/9] mm: Hardened usercopy

On 9 Jul 2016 at 14:27, Andy Lutomirski wrote:

> On Jul 6, 2016 6:25 PM, "Kees Cook" <> wrote:
> >
> > Hi,
> >
> > This is a start of the mainline port of PAX_USERCOPY[1]. After I started
> > writing tests (now in lkdtm in -next) for Casey's earlier port[2], I
> > kept tweaking things further and further until I ended up with a whole
> > new patch series. To that end, I took Rik's feedback and made a number
> > of other changes and clean-ups as well.
> >
> I like the series, but I have one minor nit to pick.  The effect of
> this series is to harden usercopy, but most of the code is really
> about infrastructure to validate that a pointed-to object is valid.

actually USERCOPY has never been about validating pointers. its sole purpose
is to validate the *size* argument of copy*user calls, a very specific form
of runtime bounds checking. it's only really relevant for slab objects and the
pointer checks (that one might mistake for being a part of the defense mechanism)
are only there to determine whether the kernel pointer refers to a slab object
or not (the stack part is a small bonus and was never the main goal either).

> Might it make sense to call the infrastructure part something else?

yes, more bikeshedding will surely help, like the renaming of .data..read_only
to .data..ro_after_init which also had nothing to do with init but everything
to do with objects being conceptually read-only...

> After all, this could be extended in the future for memcpy or even for
> some GCC plugin to check pointers passed to ordinary (non-allocator)
> functions.

what kind of checks are you thinking of here? and more fundamentally, against
what kind of threats? as for memcpy, it's the standard mandated memory copying
function, what security related properties can it check on its pointer arguments?

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.