* [PATCH] memfd: drop warning for missing exec-related flags
@ 2023-09-06 7:02 Aleksa Sarai
2023-09-06 7:13 ` Christian Brauner
2023-09-10 21:35 ` Andrew Morton
0 siblings, 2 replies; 3+ messages in thread
From: Aleksa Sarai @ 2023-09-06 7:02 UTC (permalink / raw)
To: Andrew Morton
Cc: Damian Tometzki, Aleksa Sarai, Christian Brauner, Daniel Verkamp,
Jeff Xu, Kees Cook, Shuah Khan, linux-mm, linux-kernel
Commit 434ed3350f57 ("memfd: improve userspace warnings for missing
exec-related flags") attempted to make these warnings more useful (so
they would work as an incentive to get users to switch to specifying
these flags -- as intended by the original MFD_NOEXEC_SEAL patchset).
Unfortunately, it turns out that even INFO-level logging is too extreme
to enable by default and alternative solutions to the spam issue (such
as doing more extreme rate-limiting per-task) are either too ugly or
overkill for something as simple as emitting a log as a developer aid.
Given that the flags are new and there is no harm to not specifying them
(after all, we maintain backwards compatibility) we can just drop the
warnings for now until some time in the future when most programs have
migrated and distributions start using vm.memfd_noexec=1 (where failing
to pass the flag would result in unexpected errors for programs that use
executable memfds).
Fixes: 434ed3350f57 ("memfd: improve userspace warnings for missing exec-related flags")
Reported-by: Damian Tometzki <dtometzki@fedoraproject.org>
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
---
mm/memfd.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/mm/memfd.c b/mm/memfd.c
index 1cad1904fc26..d3a1ba4208c9 100644
--- a/mm/memfd.c
+++ b/mm/memfd.c
@@ -315,12 +315,6 @@ SYSCALL_DEFINE2(memfd_create,
if ((flags & MFD_EXEC) && (flags & MFD_NOEXEC_SEAL))
return -EINVAL;
- if (!(flags & (MFD_EXEC | MFD_NOEXEC_SEAL))) {
- pr_info_ratelimited(
- "%s[%d]: memfd_create() called without MFD_EXEC or MFD_NOEXEC_SEAL set\n",
- current->comm, task_pid_nr(current));
- }
-
error = check_sysctl_memfd_noexec(&flags);
if (error < 0)
return error;
---
base-commit: 2374b401b0e0b9ab6d91eead30f9a049f8d620cf
change-id: 20230906-memfd-reduce-spam-8788fc0b951e
Best regards,
--
Aleksa Sarai <cyphar@cyphar.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] memfd: drop warning for missing exec-related flags
2023-09-06 7:02 [PATCH] memfd: drop warning for missing exec-related flags Aleksa Sarai
@ 2023-09-06 7:13 ` Christian Brauner
2023-09-10 21:35 ` Andrew Morton
1 sibling, 0 replies; 3+ messages in thread
From: Christian Brauner @ 2023-09-06 7:13 UTC (permalink / raw)
To: Aleksa Sarai
Cc: Andrew Morton, Damian Tometzki, Daniel Verkamp, Jeff Xu,
Kees Cook, Shuah Khan, linux-mm, linux-kernel
On Wed, Sep 06, 2023 at 05:02:06PM +1000, Aleksa Sarai wrote:
> Commit 434ed3350f57 ("memfd: improve userspace warnings for missing
> exec-related flags") attempted to make these warnings more useful (so
> they would work as an incentive to get users to switch to specifying
> these flags -- as intended by the original MFD_NOEXEC_SEAL patchset).
> Unfortunately, it turns out that even INFO-level logging is too extreme
> to enable by default and alternative solutions to the spam issue (such
> as doing more extreme rate-limiting per-task) are either too ugly or
> overkill for something as simple as emitting a log as a developer aid.
>
> Given that the flags are new and there is no harm to not specifying them
> (after all, we maintain backwards compatibility) we can just drop the
> warnings for now until some time in the future when most programs have
> migrated and distributions start using vm.memfd_noexec=1 (where failing
> to pass the flag would result in unexpected errors for programs that use
> executable memfds).
>
> Fixes: 434ed3350f57 ("memfd: improve userspace warnings for missing exec-related flags")
> Reported-by: Damian Tometzki <dtometzki@fedoraproject.org>
> Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
> ---
Looks good to me,
Reviewed-by: Christian Brauner <brauner@kernel.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] memfd: drop warning for missing exec-related flags
2023-09-06 7:02 [PATCH] memfd: drop warning for missing exec-related flags Aleksa Sarai
2023-09-06 7:13 ` Christian Brauner
@ 2023-09-10 21:35 ` Andrew Morton
1 sibling, 0 replies; 3+ messages in thread
From: Andrew Morton @ 2023-09-10 21:35 UTC (permalink / raw)
To: Aleksa Sarai
Cc: Damian Tometzki, Christian Brauner, Daniel Verkamp, Jeff Xu,
Kees Cook, Shuah Khan, linux-mm, linux-kernel
On Wed, 06 Sep 2023 17:02:06 +1000 Aleksa Sarai <cyphar@cyphar.com> wrote:
> Commit 434ed3350f57 ("memfd: improve userspace warnings for missing
> exec-related flags") attempted to make these warnings more useful (so
> they would work as an incentive to get users to switch to specifying
> these flags -- as intended by the original MFD_NOEXEC_SEAL patchset).
> Unfortunately, it turns out that even INFO-level logging is too extreme
> to enable by default and alternative solutions to the spam issue (such
> as doing more extreme rate-limiting per-task) are either too ugly or
> overkill for something as simple as emitting a log as a developer aid.
>
> Given that the flags are new and there is no harm to not specifying them
> (after all, we maintain backwards compatibility) we can just drop the
> warnings for now until some time in the future when most programs have
> migrated and distributions start using vm.memfd_noexec=1 (where failing
> to pass the flag would result in unexpected errors for programs that use
> executable memfds).
>
> Fixes: 434ed3350f57 ("memfd: improve userspace warnings for missing exec-related flags")
This was reverted, so please propose a new patch against 6.6-rc1.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-09-10 21:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-06 7:02 [PATCH] memfd: drop warning for missing exec-related flags Aleksa Sarai
2023-09-06 7:13 ` Christian Brauner
2023-09-10 21:35 ` Andrew Morton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox