Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
util/misc: support kernels where
MFD_NOEXEC_SEAL
does not enable se…
…aling Newer Linux kernels do not unset `F_SEAL_SEAL` when `MFD_NOEXEC_SEAL` is supplied to `memfd_create()`[0]. Currently, `misc_memfd()` has a workaround for this peculiarity of the kernel, however, this workaround will break. Avoid the breakage by checking if the kernel added `F_SEAL_SEAL`, and only try to add it if it is not already present. Note that this kernel uAPI change does not affect dbus-broker's normal operations since it never attempts to create a memfd with `MFD_NOEXEC_SEAL` and without `MFD_ALLOW_SEALING`. Only the test suite would be broken on newer kernels without this change. [0]: https://lore.kernel.org/linux-mm/[email protected]/
- Loading branch information