Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libbpf: Set MFD_NOEXEC_SEAL when creating memfd #8298

Closed
wants to merge 1 commit into from

Conversation

danobi
Copy link
Contributor

@danobi danobi commented Dec 29, 2024

Since 105ff53 ("mm/memfd: add MFD_NOEXEC_SEAL and MFD_EXEC"), the kernel has started printing a warning if neither MFD_NOEXEC_SEAL nor MFD_EXEC is set in memfd_create().

To avoid this warning (and also be more secure), set MFD_NOEXEC_SEAL by default. But since libbpf can be running on potentially very old kernels, leave a fallback for kernels without MFD_NOEXEC_SEAL support.

Since 105ff53 ("mm/memfd: add MFD_NOEXEC_SEAL and MFD_EXEC"), the
kernel has started printing a warning if neither MFD_NOEXEC_SEAL nor
MFD_EXEC is set in memfd_create().

To avoid this warning (and also be more secure), set MFD_NOEXEC_SEAL by
default. But since libbpf can be running on potentially very old
kernels, leave a fallback for kernels without MFD_NOEXEC_SEAL support.
@danobi danobi closed this Dec 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant