selftests/bpf: Use memfd_create instead of shm_open in cgroup_iter_memcg

Replace shm_open/shm_unlink with memfd_create in the shmem subtest.
shm_open requires /dev/shm to be mounted, which is not always available
in test environments, causing the test to fail with ENOENT.
memfd_create creates an anonymous shmem-backed fd without any filesystem
dependency while exercising the same shmem accounting path.

Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20260412210636.47516-1-alexei.starovoitov@gmail.com
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
This commit is contained in:
Alexei Starovoitov 2026-04-12 14:06:36 -07:00 • committed by Kumar Kartikeya Dwivedi
commit 47687a29b2
No known key found for this signature in database
GPG key ID: 472D377B63542F83