[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <78bb0097-7dca-254f-45a6-5cea6baec0c4@intel.com>
Date: Tue, 16 May 2023 16:18:56 -0700
From: Dave Hansen <dave.hansen@...el.com>
To: jeffxu@...omium.org, luto@...nel.org, jorgelo@...omium.org,
keescook@...omium.org, groeck@...omium.org, jannh@...gle.com,
sroettger@...gle.com
Cc: akpm@...ux-foundation.org, jeffxu@...gle.com,
linux-kernel@...r.kernel.org, linux-kselftest@...r.kernel.org,
linux-mm@...ck.org, linux-hardening@...r.kernel.org
Subject: Re: [PATCH 3/6] PKEY: Apply PKEY_ENFORCE_API to mprotect
On 5/15/23 06:05, jeffxu@...omium.org wrote:
> /*
> * pkey==-1 when doing a legacy mprotect()
> + * syscall==true if this is called by syscall from userspace.
> + * Note: this is always true for now, added as a reminder in case that
> + * do_mprotect_pkey is called directly by kernel in the future.
> + * Also it is consistent with __do_munmap().
> */
> static int do_mprotect_pkey(unsigned long start, size_t len,
> - unsigned long prot, int pkey)
> + unsigned long prot, int pkey, bool syscall)
> {
The 'syscall' seems kinda silly (and a bit confusing). It's easy to
check if the caller is a kthread or has a current->mm==NULL. If you
*really* want a warning, I'd check for those rather than plumb a
apparently unused argument in here.
BTW, this warning is one of those things that will probably cause some
amount of angst. I'd move it to the end of the series or just axe it
completely.
Powered by blists - more mailing lists