Comment 11 for bug 1990849

Revision history for this message
Aleksandr Mikhalitsyn (mihalicyn) wrote (last edit ):

Dear friends,

Right now I'm on the way to understand what's happening with this.

# strace touch b
execve("/usr/bin/touch", ["touch", "b"], 0x7ffd29f848a8 /* 7 vars */) = 0
brk(NULL) = 0x56007dba6000
arch_prctl(0x3001 /* ARCH_??? */, 0x7fff436afcb0) = -1 EINVAL (Invalid argument)
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f6bb5d2d000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
<...>
openat(AT_FDCWD, "b", O_WRONLY|O_CREAT|O_NOCTTY|O_NONBLOCK, 0666) = -1 EOVERFLOW (Value too large for defined data type)

From ftrace/perf trace:
  877.582556 | 0) | /* do_sys_openat2__return: (__x64_sys_openat+0x55/0x90 <- do_sys_openat2) arg1=0xffffffffffffffb5 */

0xffffffffffffffb5 it's 2's complement of -EOVERFLOW error

I've finally traced it to:
static inline int may_create(struct user_namespace *mnt_userns,
        struct inode *dir, struct dentry *child)
{
 audit_inode_child(dir, child, AUDIT_TYPE_CHILD_CREATE);
 if (child->d_inode)
  return -EEXIST;
 if (IS_DEADDIR(dir))
  return -ENOENT;
 if (!fsuidgid_has_mapping(dir->i_sb, mnt_userns))
  return -EOVERFLOW; // <<< looks like error comes from here

My suspicion is that the problem is caused by these two changes, which are potentially incompatible with shiftfs:
+ - fs: tweak fsuidgid_has_mapping()
+ - fs: support mapped mounts of mapped filesystems
(changelog from https://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/jammy/commit/?h=Ubuntu-5.15.0-48.54&id=941bdeb5ab2258758fce5f4d06296da98bfa7e82)

Will continue investigation.