[BUG] selftest: memfd: indefinite hang in ./fuse_mnt ./mnt

From: Mirsad Todorovac
Date: Tue Feb 27 2024 - 09:00:30 EST


Hi everybody,

This is an issue already reported in thread:

Link: https://lore.kernel.org/all/4a5aa618-8fbc-4053-ba38-0809735d864b@xxxxxxxxxxxx/

around January 7th.

It is again against the latest vanilla torvalds build on Ubuntu 23.10 and
an AMD Ryzen 7 box.

Please find the .config attached.

Here are some diagnostics and log outputs:

root@stargazer:/home/marvin/linux/kernel/linux_torvalds# lsof -p 85021
lsof: WARNING: can't stat() fuse.portal file system /run/user/1000/doc
Output information may be incomplete.
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs
Output information may be incomplete.
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
fuse_mnt 85021 root cwd DIR 259,13 4096 2 /
fuse_mnt 85021 root rtd DIR 259,13 4096 2 /
fuse_mnt 85021 root txt REG 0,44 16760 7558526 /home/marvin/linux/kernel/linux_torvalds/tools/testing/selftests/memfd/fuse_mnt
fuse_mnt 85021 root mem REG 0,40 7558526 /home/marvin/linux/kernel/linux_torvalds/tools/testing/selftests/memfd/fuse_mnt (path dev=0,44)
fuse_mnt 85021 root mem REG 0,26 481843 /usr/lib/x86_64-linux-gnu/libc.so.6 (path dev=0,27)
fuse_mnt 85021 root mem REG 0,26 434443 /usr/lib/x86_64-linux-gnu/libfuse.so.2.9.9 (path dev=0,27)
fuse_mnt 85021 root mem REG 0,26 22118 /usr/libexec/coreutils/libstdbuf.so (path dev=0,27)
fuse_mnt 85021 root mem REG 0,26 481840 /usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 (path dev=0,27)
fuse_mnt 85021 root 0u CHR 1,3 0t0 5 /dev/null
fuse_mnt 85021 root 1u CHR 1,3 0t0 5 /dev/null
fuse_mnt 85021 root 2u CHR 1,3 0t0 5 /dev/null
fuse_mnt 85021 root 3w FIFO 0,14 0t0 404306 pipe
fuse_mnt 85021 root 4w FIFO 0,14 0t0 19072 pipe
fuse_mnt 85021 root 5u CHR 10,229 0t0 88 /dev/fuse
root@stargazer:/home/marvin/linux/kernel/linux_torvalds# strace -p !$
strace -p 85021
strace: Process 85021 attached
futex(0x7ffc1a7c9ea0, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, NULL, FUTEX_BITSET_MATCH_ANY^Cstrace: Process 85021 detached
<detached ...>

root@stargazer:/home/marvin/linux/kernel/linux_torvalds#

make[3]: Entering directory '/home/marvin/linux/kernel/linux_torvalds/tools/testing/selftests/memfd'
TAP version 13
1..3
# timeout set to 45
# selftests: memfd: memfd_test
# memfd: CREATE
# memfd: BASIC
# memfd: SEAL-EXEC
# memfd: Apply SEAL_EXEC
# memfd: Apply ALL_SEALS
# memfd: EXEC_NO_SEAL
# memfd: NOEXEC_SEAL
# memfd: SEAL-WRITE
# memfd: SEAL-FUTURE-WRITE
# memfd: SEAL-SHRINK
# memfd: SEAL-GROW
# memfd: SEAL-RESIZE
# memfd: sysctl 0
# memfd: sysctl 1
# memfd: sysctl 0
# memfd: sysctl 2
# memfd: sysctl 1
# memfd: sysctl 0
# memfd: nested sysctl 0
# memfd: sysctl 0
# memfd: sysctl 1
# memfd: sysctl 0
# memfd: sysctl 2
# memfd: sysctl 1
# memfd: sysctl 0
# memfd: nested sysctl 1
# memfd: nested sysctl 2
# memfd: nested sysctl 0 -> 1 after fork
# memfd: nested sysctl 0 -> 2 after fork
# memfd: nested sysctl 2 -> 1 after fork
# memfd: nested sysctl 2 -> 0 after fork
# memfd: nested sysctl 1 -> 0 after fork
# memfd: SHARE-DUP
# memfd: SHARE-MMAP
# memfd: SHARE-OPEN
# memfd: SHARE-FORK
# memfd: SHARE-DUP (shared file-table)
# memfd: SHARE-MMAP (shared file-table)
# memfd: SHARE-OPEN (shared file-table)
# memfd: SHARE-FORK (shared file-table)
# memfd: DONE
ok 1 selftests: memfd: memfd_test
# timeout set to 45
# selftests: memfd: run_fuse_test.sh
# opening: ./mnt/memfd
# fuse: DONE
ok 2 selftests: memfd: run_fuse_test.sh
# timeout set to 45
# selftests: memfd: run_hugetlbfs_test.sh
# memfd-hugetlb: CREATE
# memfd-hugetlb: BASIC
# memfd-hugetlb: SEAL-EXEC
# memfd-hugetlb: Apply SEAL_EXEC
# fchmod(/memfd:kern_memfd_seal_exec (deleted), 00777) didn't fail as expected
# ./run_hugetlbfs_test.sh: line 60: 85016 Aborted (core dumped) ./memfd_test hugetlbfs
# opening: ./mnt/memfd
# ADD_SEALS(6, 0 -> 8) failed: Device or resource busy
# 8 != 0 = GET_SEALS(6)
# Aborted (core dumped)
ok 3 selftests: memfd: run_hugetlbfs_test.sh
make[3]: Leaving directory '/home/marvin/linux/kernel/linux_torvalds/tools/testing/selftests/memfd'

Best regards,
Mirsad Todorovac

--
CARNet system engineer
Faculty of Graphic Arts | Academy of Fine Arts
University of Zagreb

CARNet sistem inženjer
Grafički fakultet | Akademija likovnih umjetnosti
Sveučilište u Zagrebu

Attachment: config-6.8.0-rc6-kmemlk-00011-g45ec2f5f6ed3.xz
Description: application/xz