[BUG] list memory mapped files returns with 'stat: No such file or directory'
Describe the bug list memory mapped files in different mount namespace return with 'stat: No such file or directory'.
To Reproduce Steps to reproduce the behavior:
- Run 'lsof -p
', this pid in a different mount namespace from lsof itself, for example, a container process. - See error
Expected behavior Should not print 'stat: No such file or directory'.
Program output COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME bash 2307034 root cwd DIR 0,104 4096 2233949 /root bash 2307034 root rtd DIR 0,104 4096 2361890 / bash 2307034 root txt REG 0,104 964536 2234000 /usr/bin/bash bash 2307034 root mem REG 254,1 2234000 /usr/bin/bash (path inode=263609) bash 2307034 root mem REG 254,1 2236028 /usr/lib64/libnss_files-2.17.so (stat: No such file or directory) bash 2307034 root mem REG 254,1 2235885 /usr/lib64/libc-2.17.so (stat: No such file or directory) bash 2307034 root mem REG 254,1 2235914 /usr/lib64/libdl-2.17.so (stat: No such file or directory) bash 2307034 root mem REG 254,1 2236135 /usr/lib64/libtinfo.so.5.9 (stat: No such file or directory) bash 2307034 root mem REG 254,1 2235861 /usr/lib64/ld-2.17.so (stat: No such file or directory) bash 2307034 root 0u CHR 136,0 0t0 3 /dev/pts/0 bash 2307034 root 1u CHR 136,0 0t0 3 /dev/pts/0 bash 2307034 root 2u CHR 136,0 0t0 3 /dev/pts/0 bash 2307034 root 255u CHR 136,0 0t0 3 /dev/pts/0
Environment (please complete the following information):
- Kernel: 4.19
- OS: Debian
- lsof Version: 4.91
#239
I think we have similar problem with regard to other namespaces, e.g. userns, netns.