Re: util-linux 2.39 doesn't work with <linux-5.12: mount(2) system call failed: Function not implemented

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Thomas :)

On 2023-05-20 06:51, Thomas Weißschuh wrote:
Could you test the fix proposed in
https://github.com/util-linux/util-linux/pull/2248 ?

(For testing on a real system you only need the changes to
libmount/src/hook_mount.c, ignore the testing stuff)

This is addressing the reported

  mount --make-slave /proc

issue. I.e. in strace you will see your added call to mount_setattr_is_supported() which will fail because it is not supported but afterwards it will try old syscall:

getuid()                                = 0
geteuid()                               = 0
open_tree(AT_FDCWD, "/", OPEN_TREE_CLOEXEC) = 3
mount_setattr(-1, NULL, 0, NULL, 0)     = -1 ENOSYS (Function not implemented)
getuid()                                = 0
geteuid()                               = 0
getgid()                                = 0
getegid()                               = 0
prctl(PR_GET_DUMPABLE)                  = 1 (SUID_DUMP_USER)
newfstatat(AT_FDCWD, "/run/mount/utab", 0x7ffdfabad380, AT_SYMLINK_NOFOLLOW) = -1 ENOENT (No such file or directory)
mkdir("/run/mount", 0755)               = -1 EEXIST (File exists)
newfstatat(AT_FDCWD, "/run/mount/utab", 0x7ffdfabad270, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/run/mount", {st_mode=S_IFDIR|0755, st_size=40, ...}, 0) = 0
geteuid()                               = 0
getegid()                               = 0
getuid()                                = 0
getgid()                                = 0
access("/run/mount", R_OK|W_OK)         = 0
mount("none", "/", NULL, MS_SLAVE, NULL) = 0
close(3)                                = 0

However, I noticed additional problems. Remounts for example are still not working but no error is shown:

~ # findmnt /
TARGET  SOURCE    FSTYPE OPTIONS
/       /dev/dm-0 ext4   ro,relatime,stripe=32650
~ # mount -o remount,rw /
~ # findmnt /
TARGET   SOURCE    FSTYPE OPTIONS
/        /dev/dm-0 ext4   ro,relatime,stripe=32650

I don't see a fallback in strace:

> [...]
open_tree(AT_FDCWD, "/", OPEN_TREE_CLOEXEC) = 3
mount_setattr(-1, NULL, 0, NULL, 0)     = -1 ENOSYS (Function not implemented)
getuid()                                = 0
geteuid()                               = 0
getgid()                                = 0
getegid()                               = 0
prctl(PR_GET_DUMPABLE)                  = 1 (SUID_DUMP_USER)
newfstatat(AT_FDCWD, "/run/mount/utab", 0x7ffe4fe7c590, AT_SYMLINK_NOFOLLOW) = -1 ENOENT (No such file or directory)
mkdir("/run/mount", 0755)               = -1 EEXIST (File exists)
newfstatat(AT_FDCWD, "/run/mount/utab", 0x7ffe4fe7c480, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/run/mount", {st_mode=S_IFDIR|0755, st_size=40, ...}, 0) = 0
geteuid()                               = 0
getegid()                               = 0
getuid()                                = 0
getgid()                                = 0
access("/run/mount", R_OK|W_OK)         = 0
fspick(3, "", FSPICK_NO_AUTOMOUNT|FSPICK_EMPTY_PATH) = 4
fsconfig(4, FSCONFIG_SET_FLAG, "rw", NULL, 0) = 0
fsconfig(4, FSCONFIG_CMD_RECONFIGURE, NULL, NULL, 0) = 0
close(4)                                = 0
close(3)                                = 0
dup(1)                                  = 3
close(3)                                = 0
dup(2)                                  = 3
close(3)                                = 0
exit_group(0)                           = ?
+++ exited with 0 +++



--
Regards,
Thomas



[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux