Skip to content

MemoryDenyWriteExecute should block memfd_create #11473

Description

@topimiettinen

Is your feature request related to a problem? Please describe.
memfd_create() together with mmap() can be used to generate arbitrary executable memory contents, circumventing MemoryDenyWriteExecute=yes.

Describe the solution you'd like
MemoryDenyWriteExecute=yes should install a seccomp filter for memfd_create(). This could be a problem for compatibility.

Describe alternatives you've considered

  • Administrators could install a seccomp filter for memfd_create with SystemCallFilter directive, so no changes would be needed.
    However, systemd-analyze security could educate them about the need of such filter. Supplied systemd service unit files should also include the filter when possible.

  • Compatibility could be kept while still using MemoryDenyWriteExecute for blocking memfd_create(), with a new non-boolean setting to it, like MemoryDenyWriteExecute=strict.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions