[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3E68D344-E053-4F32-91D0-2665508267BB@fb.com>
Date: Tue, 23 Aug 2022 06:57:16 +0000
From: Song Liu <songliubraving@...com>
To: Christophe Leroy <christophe.leroy@...roup.eu>
CC: Peter Zijlstra <peterz@...radead.org>,
Linux-MM <linux-mm@...ck.org>,
lkml <linux-kernel@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
X86 ML <x86@...nel.org>, Christoph Hellwig <hch@....de>,
Kernel Team <Kernel-team@...com>,
"Edgecombe, Rick P" <rick.p.edgecombe@...el.com>,
Luis Chamberlain <mcgrof@...nel.org>,
Dave Hansen <dave.hansen@...el.com>, Song Liu <song@...nel.org>
Subject: Re: [RFC 0/5] vmalloc_exec for modules and BPF programs
> On Aug 22, 2022, at 11:39 PM, Christophe Leroy <christophe.leroy@...roup.eu> wrote:
>
>
>
> Le 23/08/2022 à 07:42, Peter Zijlstra a écrit :
>> On Mon, Aug 22, 2022 at 04:56:47PM +0000, Song Liu wrote:
>>>
>>>
>>>> On Aug 22, 2022, at 9:34 AM, Peter Zijlstra <peterz@...radead.org> wrote:
>>>>
>>>> On Mon, Aug 22, 2022 at 03:46:38PM +0000, Song Liu wrote:
>>>>> Could you please share your feedback on this?
>>>>
>>>> I've looked at it all of 5 minutes, so perhaps I've missed something.
>>>>
>>>> However, I'm a little surprised you went with a second tree instead of
>>>> doing the top-down thing for data. The way you did it makes it hard to
>>>> have guard pages between text and data.
>>>
>>> I didn't realize the importance of the guard pages. But it is not too
>>
>> I'm not sure how important it is, just seems like a good idea to trap
>> anybody trying to cross that divide. Also, to me it seems like a good
>> idea to have a single large contiguous text region instead of splintered
>> 2M pages.
>>
>>> hard to do it with this approach. For each 2MB text page, we can reserve
>>> 4kB on the beginning and end of it. Would this work?
>>
>> Typically a guard page has different protections (as in none what so
>> ever) so that every access goes *splat*. >
>
> Text is RO-X, on some architectures even only X. So the only real thing
> to protect against is bad execution, isn't it ?. So I guess having some
> areas with invalid or trap instructions would be enough ?
Agreed that filling with trap instructions should be enough.
Thanks,
Song
Powered by blists - more mailing lists