[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZFQQSKijXQHWlYaI@x1n>
Date: Thu, 4 May 2023 16:06:32 -0400
From: Peter Xu <peterx@...hat.com>
To: Florent Revest <revest@...omium.org>
Cc: linux-kernel@...r.kernel.org, linux-mm@...ck.org,
akpm@...ux-foundation.org, catalin.marinas@....com,
anshuman.khandual@....com, joey.gouly@....com, mhocko@...e.com,
keescook@...omium.org, david@...hat.com, izbyshev@...ras.ru,
nd@....com, broonie@...nel.org, szabolcs.nagy@....com
Subject: Re: [PATCH 0/4] MDWE without inheritance
On Thu, May 04, 2023 at 07:09:38PM +0200, Florent Revest wrote:
> Joey recently introduced a Memory-Deny-Write-Executable (MDWE) prctl which tags
> current with a flag that prevents pages that were previously not executable from
> becoming executable.
> This tag always gets inherited by children tasks. (it's in MMF_INIT_MASK)
>
> At Google, we've been using a somewhat similar downstream patch for a few years
> now. To make the adoption of this feature easier, we've had it support a mode in
> which the W^X flag does not propagate to children. For example, this is handy if
> a C process which wants W^X protection suspects it could start children
> processes that would use a JIT.
>
> I'd like to align our features with the upstream prctl. This series proposes a
> new NO_INHERIT flag to the MDWE prctl to make this kind of adoption easier. It
> sets a different flag in current that is not in MMF_INIT_MASK and which does not
> propagate.
I don't think I have enough context, so sorry if I'm going to ask a naive
question..
I can understand how current MDWE helps on not allowing any modifi-able
content from becoming executable. How could NO_INHERIT help if it won't
inherit and not in MMF_INIT_MASK?
IIUC it means the restriction will only apply to the current process. Then
I assume the process can escape from this rule simply by a fork(). If so,
what's the point to protect at all?
And, what's the difference of this comparing to disabling MDWE after being
enabled (which seems to be forbidden for now, but it seems fork() can play
a similar role of disabling it)?
Thanks,
--
Peter Xu
Powered by blists - more mailing lists