1 .. title:: clang-tidy - android-cloexec-memfd-create
3 android-cloexec-memfd-create
4 ============================
6 ``memfd_create()`` should include ``MFD_CLOEXEC`` in its type argument to avoid
7 the file descriptor leakage. Without this flag, an opened sensitive file would
8 remain open across a fork+exec to a lower-privileged SELinux domain.
14 memfd_create(name, MFD_ALLOW_SEALING);
18 memfd_create(name, MFD_ALLOW_SEALING | MFD_CLOEXEC);