[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <202406121123.B0F60E91E@keescook>
Date: Wed, 12 Jun 2024 11:23:48 -0700
From: Kees Cook <kees@...nel.org>
To: Adrian Ratiu <adrian.ratiu@...labora.com>
Cc: linux-fsdevel@...r.kernel.org, linux-security-module@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-hardening@...r.kernel.org,
linux-doc@...r.kernel.org, kernel@...labora.com, gbiv@...gle.com,
ryanbeltran@...gle.com, inglorion@...gle.com, ajordanr@...gle.com,
jorgelo@...omium.org, Guenter Roeck <groeck@...omium.org>,
Doug Anderson <dianders@...omium.org>, Jann Horn <jannh@...gle.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Randy Dunlap <rdunlap@...radead.org>,
Christian Brauner <brauner@...nel.org>, Jeff Xu <jeffxu@...gle.com>,
Mike Frysinger <vapier@...omium.org>
Subject: Re: [PATCH v5 2/2] proc: restrict /proc/pid/mem
On Wed, Jun 12, 2024 at 07:13:41PM +0100, Adrian Ratiu wrote:
> Would macros like the following be acceptable?
> I know it's more verbose but also much easier to understand and it works.
>
> #if IS_ENABLED(CONFIG_PROC_MEM_RESTRICT_OPEN_READ_ALL)
> DEFINE_STATIC_KEY_TRUE_RO(proc_mem_restrict_open_read_all);
> DEFINE_STATIC_KEY_FALSE_RO(proc_mem_restrict_open_read_ptracer);
> #elif IS_ENABLED(CONFIG_PROC_MEM_RESTRICT_OPEN_READ_PTRACE)
> DEFINE_STATIC_KEY_FALSE_RO(proc_mem_restrict_open_read_all);
> DEFINE_STATIC_KEY_TRUE_RO(proc_mem_restrict_open_read_ptracer);
> #else
> DEFINE_STATIC_KEY_FALSE_RO(proc_mem_restrict_open_read_all);
> DEFINE_STATIC_KEY_FALSE_RO(proc_mem_restrict_open_read_ptracer);
> #endif
Yeah, that'd be fine by me. I was a little concerned I was
over-generalizing those macros. :P
--
Kees Cook
Powered by blists - more mailing lists