Re: [patch 05/16] mm: Allow special mappings with user access cleared
From: Andy Lutomirski
Date: Wed Dec 13 2017 - 13:31:48 EST
On Wed, Dec 13, 2017 at 10:08 AM, Linus Torvalds
<torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
> On Wed, Dec 13, 2017 at 7:54 AM, Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
>>
>> Which is why get_user_pages() _should_ enforce this.
>>
>> What use are protection keys if you can trivially circumvent them?
>
> No, we will *not* worry about protection keys in get_user_pages().
>
Hmm. If I goof some pointer and pass that bogus pointer to read(2),
and I'm using pkey to protect my mmapped database, I think i'd rather
that read(2) fail. Sure, pkey is trivially circumventable using
wrpkru or mprotect, but those are obvious dangerous functions.