You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Changing memfd_create() in allocate_shm_file() apears to fix this for me, but note the call can fail on older kernels before 6.3, solution seems to be just to try to allocate, if fails, try again without the new flag, but I haven't tested that:
int fd = memfd_create("surface", MFD_CLOEXEC | MFD_ALLOW_SEALING | MFD_NOEXEC_SEAL);
I also added:
if (fcntl(fd, F_ADD_SEALS,
F_SEAL_GROW | F_SEAL_SHRINK | F_SEAL_SEAL) < 0)
{
fprintf(stderr, "Warning: failed to seal SHM memory file.");
}
before returning the fd.
The text was updated successfully, but these errors were encountered:
Hi, I'm getting a warning in the system log:
dwlb[492]: memfd_create() called without MFD_EXEC or MFD_NOEXEC_SEAL set
This appears to be due to this kernel patch applied to kernels 6.3 onwards:
https://lore.kernel.org/linux-security-module/20221209160453.3246150-4-jeffxu@google.com/
Changing memfd_create() in allocate_shm_file() apears to fix this for me, but note the call can fail on older kernels before 6.3, solution seems to be just to try to allocate, if fails, try again without the new flag, but I haven't tested that:
int fd = memfd_create("surface", MFD_CLOEXEC | MFD_ALLOW_SEALING | MFD_NOEXEC_SEAL);
I also added:
if (fcntl(fd, F_ADD_SEALS,
F_SEAL_GROW | F_SEAL_SHRINK | F_SEAL_SEAL) < 0)
{
fprintf(stderr, "Warning: failed to seal SHM memory file.");
}
before returning the fd.
The text was updated successfully, but these errors were encountered: