canonical / wlcs

Wayland Conformance Test Suite
GNU General Public License v2.0
50 stars 14 forks source link

helpers: avoid triggering a kernel warning #320

Closed RAOF closed 12 months ago

RAOF commented 12 months ago

In kernels ≥ 6.3 there's a warning generated when you create a memfd without setting one of MFD_NOEXEC_SEAL or MFD_EXEC. Since we don't need to be able to execute our shm buffers, set MFD_NOEXEC_SEAL when:

memfd_create will return EINVAL if it doesn't understand MFD_NOEXEC_SEAL (ie: if it's too old), so it's easy to fallback.