diff --git a/src/basic/memfd-util.c b/src/basic/memfd-util.c index 96bbba35e6f..42ceb93545c 100644 --- a/src/basic/memfd-util.c +++ b/src/basic/memfd-util.c @@ -24,6 +24,11 @@ int memfd_create_wrapper(const char *name, unsigned mode) { unsigned mode_compat; int mfd; + assert(name); + + /* Wrapper around memfd_create() which adds compat with older kernels where memfd_create() didn't + * support MFD_EXEC/MFD_NOEXEC_SEAL. (kernel 6.3+) */ + mfd = RET_NERRNO(memfd_create(name, mode)); if (mfd != -EINVAL) return mfd;