[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <08c91835-8486-9da5-a7d1-75e716fc5d36@intel.com>
Date: Wed, 9 Sep 2020 16:07:07 -0700
From: "Yu, Yu-cheng" <yu-cheng.yu@...el.com>
To: Dave Hansen <dave.hansen@...el.com>,
Andy Lutomirski <luto@...nel.org>
Cc: Dave Martin <Dave.Martin@....com>, "H.J. Lu" <hjl.tools@...il.com>,
Florian Weimer <fweimer@...hat.com>, X86 ML <x86@...nel.org>,
"H. Peter Anvin" <hpa@...or.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
LKML <linux-kernel@...r.kernel.org>,
"open list:DOCUMENTATION" <linux-doc@...r.kernel.org>,
Linux-MM <linux-mm@...ck.org>,
linux-arch <linux-arch@...r.kernel.org>,
Linux API <linux-api@...r.kernel.org>,
Arnd Bergmann <arnd@...db.de>,
Balbir Singh <bsingharora@...il.com>,
Borislav Petkov <bp@...en8.de>,
Cyrill Gorcunov <gorcunov@...il.com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Eugene Syromiatnikov <esyr@...hat.com>,
Jann Horn <jannh@...gle.com>, Jonathan Corbet <corbet@....net>,
Kees Cook <keescook@...omium.org>,
Mike Kravetz <mike.kravetz@...cle.com>,
Nadav Amit <nadav.amit@...il.com>,
Oleg Nesterov <oleg@...hat.com>, Pavel Machek <pavel@....cz>,
Peter Zijlstra <peterz@...radead.org>,
Randy Dunlap <rdunlap@...radead.org>,
"Ravi V. Shankar" <ravi.v.shankar@...el.com>,
Vedvyas Shanbhogue <vedvyas.shanbhogue@...el.com>,
Weijiang Yang <weijiang.yang@...el.com>
Subject: Re: [PATCH v11 25/25] x86/cet/shstk: Add arch_prctl functions for
shadow stack
On 9/9/2020 3:59 PM, Dave Hansen wrote:
> On 9/9/20 3:08 PM, Yu, Yu-cheng wrote:
>> After looking at this more, I found the changes are more similar to
>> mprotect() than madvise(). We are going to change an anonymous mapping
>> to a read-only mapping, and add the VM_SHSTK flag to it. Would an
>> x86-specific mprotect(PROT_SHSTK) make more sense?
>>
>> One alternative would be requiring a read-only mapping for
>> madvise(MADV_SHSTK). But that is inconvenient for the application.
>
> Why? It's just:
>
> mmap()/malloc();
> mprotect(PROT_READ);
> madvise(MADV_SHSTK);
>
> vs.
>
> mmap()/malloc();
> mprotect(PROT_SHSTK);
>
> I'm not sure a single syscall counts as inconvenient.
>
> I don't quite think we should use a PROT_ bit for this. It seems like
> the kind of thing that could be fragile and break existing expectations.
> I don't care _that_ strongly though.
>
What if a writable mapping is passed to madvise(MADV_SHSTK)? Should
that be rejected?
Powered by blists - more mailing lists