Skip to content

Commit 1717449

Browse files
cypharakpm00
authored andcommitted
memfd: drop warning for missing exec-related flags
Commit 434ed33 ("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). Link: https://lkml.kernel.org/r/[email protected] Fixes: 434ed33 ("memfd: improve userspace warnings for missing exec-related flags") Fixes: 2562d67 ("revert "memfd: improve userspace warnings for missing exec-related flags".") Signed-off-by: Aleksa Sarai <[email protected]> Reported-by: Damian Tometzki <[email protected]> Reviewed-by: Christian Brauner <[email protected]> Cc: Daniel Verkamp <[email protected]> Cc: Jeff Xu <[email protected]> Cc: Kees Cook <[email protected]> Cc: Shuah Khan <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 84e8e54 commit 1717449

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

mm/memfd.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -315,12 +315,6 @@ SYSCALL_DEFINE2(memfd_create,
315315
if ((flags & MFD_EXEC) && (flags & MFD_NOEXEC_SEAL))
316316
return -EINVAL;
317317

318-
if (!(flags & (MFD_EXEC | MFD_NOEXEC_SEAL))) {
319-
pr_warn_once(
320-
"%s[%d]: memfd_create() called without MFD_EXEC or MFD_NOEXEC_SEAL set\n",
321-
current->comm, task_pid_nr(current));
322-
}
323-
324318
error = check_sysctl_memfd_noexec(&flags);
325319
if (error < 0)
326320
return error;

0 commit comments

Comments
 (0)