Re: [PATCH] kernel/fs: last check for exec credentials on NOEXEC mount

From: Kees Cook
Date: Thu Aug 01 2024 - 23:28:25 EST




On August 1, 2024 5:07:45 AM PDT, "Wojciech Gładysz" <wojciech.gladysz@xxxxxxxxxxxx> wrote:
>Test case: thread mounts NOEXEC fuse to a file being executed.
>WARN_ON_ONCE is triggered yielding panic for some config.
>Add a check to security_bprm_creds_for_exec(bprm).

As others have noted, this is racy. I would still like to keep the redundant check as-is, but let's lower it from WARN to pr_warn_ratelimited, since it's a known race that can be reached from userspace.

--
Kees Cook