Merge tag 'vfs-6.15-rc1.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs

Pull vfs fixes from Christian Brauner:

- Add a new maintainer for configfs

- Fix exportfs module description

- Place flexible array memeber at the end of an internal struct in the
mount code

- Add new maintainer for netfslib as Jeff Layton is stepping down as
current co-maintainer

- Fix error handling in cachefiles_get_directory()

- Cleanup do_notify_pidfd()

- Fix syscall number definitions in pidfd selftests

- Fix racy usage of fs_struct->in exec during multi-threaded exec

- Ensure correct exit code is reported when pidfs_exit() is called from
release_task() for a delayed thread-group leader exit

- Fix conflicting iomap flag definitions

* tag 'vfs-6.15-rc1.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs:
iomap: Fix conflicting values of iomap flags
fs: namespace: Avoid -Wflex-array-member-not-at-end warning
MAINTAINERS: configfs: add Andreas Hindborg as maintainer
exportfs: add module description
exit: fix the usage of delay_group_leader->exit_code in do_notify_parent() and pidfs_exit()
netfs: add Paulo as maintainer and remove myself as Reviewer
cachefiles: Fix oops in vfs_mkdir from cachefiles_get_directory
exec: fix the racy usage of fs_struct->in_exec
selftests/pidfd: fixes syscall number defines
pidfs: cleanup the usage of do_notify_pidfd()

+45 -37
+4
CREDITS
··· 317 317 S: Greenbelt, Maryland 20771 318 318 S: USA 319 319 320 + N: Joel Becker 321 + E: jlbec@evilplan.org 322 + D: configfs 323 + 320 324 N: Adam Belay 321 325 E: ambx1@neo.rr.com 322 326 D: Linux Plug and Play Support
+4 -3
MAINTAINERS
··· 5967 5967 F: Documentation/security/snp-tdx-threat-model.rst 5968 5968 5969 5969 CONFIGFS 5970 - M: Joel Becker <jlbec@evilplan.org> 5970 + M: Andreas Hindborg <a.hindborg@kernel.org> 5971 + R: Breno Leitao <leitao@debian.org> 5971 5972 S: Supported 5972 - T: git git://git.infradead.org/users/hch/configfs.git 5973 + T: git git://git.kernel.org/pub/scm/linux/kernel/git/a.hindborg/linux.git configfs-next 5973 5974 F: fs/configfs/ 5974 5975 F: include/linux/configfs.h 5975 5976 F: samples/configfs/ ··· 9107 9106 9108 9107 FILESYSTEMS [NETFS LIBRARY] 9109 9108 M: David Howells <dhowells@redhat.com> 9110 - R: Jeff Layton <jlayton@kernel.org> 9109 + M: Paulo Alcantara <pc@manguebit.com> 9111 9110 L: netfs@lists.linux.dev 9112 9111 L: linux-fsdevel@vger.kernel.org 9113 9112 S: Supported
+4 -3
fs/cachefiles/namei.c
··· 128 128 ret = security_path_mkdir(&path, subdir, 0700); 129 129 if (ret < 0) 130 130 goto mkdir_error; 131 - subdir = ERR_PTR(cachefiles_inject_write_error()); 132 - if (!IS_ERR(subdir)) 131 + ret = cachefiles_inject_write_error(); 132 + if (ret == 0) 133 133 subdir = vfs_mkdir(&nop_mnt_idmap, d_inode(dir), subdir, 0700); 134 - ret = PTR_ERR(subdir); 134 + else 135 + subdir = ERR_PTR(ret); 135 136 if (IS_ERR(subdir)) { 136 137 trace_cachefiles_vfs_error(NULL, d_inode(dir), ret, 137 138 cachefiles_trace_mkdir_error);
+9 -6
fs/exec.c
··· 1227 1227 */ 1228 1228 bprm->point_of_no_return = true; 1229 1229 1230 - /* 1231 - * Make this the only thread in the thread group. 1232 - */ 1230 + /* Make this the only thread in the thread group */ 1233 1231 retval = de_thread(me); 1234 1232 if (retval) 1235 1233 goto out; 1236 - 1234 + /* see the comment in check_unsafe_exec() */ 1235 + current->fs->in_exec = 0; 1237 1236 /* 1238 1237 * Cancel any io_uring activity across execve 1239 1238 */ ··· 1494 1495 } 1495 1496 free_arg_pages(bprm); 1496 1497 if (bprm->cred) { 1498 + /* in case exec fails before de_thread() succeeds */ 1499 + current->fs->in_exec = 0; 1497 1500 mutex_unlock(&current->signal->cred_guard_mutex); 1498 1501 abort_creds(bprm->cred); 1499 1502 } ··· 1617 1616 * suid exec because the differently privileged task 1618 1617 * will be able to manipulate the current directory, etc. 1619 1618 * It would be nice to force an unshare instead... 1619 + * 1620 + * Otherwise we set fs->in_exec = 1 to deny clone(CLONE_FS) 1621 + * from another sub-thread until de_thread() succeeds, this 1622 + * state is protected by cred_guard_mutex we hold. 1620 1623 */ 1621 1624 n_fs = 1; 1622 1625 spin_lock(&p->fs->lock); ··· 1865 1860 1866 1861 sched_mm_cid_after_execve(current); 1867 1862 /* execve succeeded */ 1868 - current->fs->in_exec = 0; 1869 1863 current->in_execve = 0; 1870 1864 rseq_execve(current); 1871 1865 user_events_execve(current); ··· 1883 1879 force_fatal_sig(SIGSEGV); 1884 1880 1885 1881 sched_mm_cid_after_execve(current); 1886 - current->fs->in_exec = 0; 1887 1882 current->in_execve = 0; 1888 1883 1889 1884 return retval;
+1
fs/exportfs/expfs.c
··· 608 608 } 609 609 EXPORT_SYMBOL_GPL(exportfs_decode_fh); 610 610 611 + MODULE_DESCRIPTION("Code mapping from inodes to file handles"); 611 612 MODULE_LICENSE("GPL");
+3 -1
fs/namespace.c
··· 5326 5326 struct mnt_idmap *idmap; 5327 5327 u64 mask; 5328 5328 struct path root; 5329 - struct statmount sm; 5330 5329 struct seq_file seq; 5330 + 5331 + /* Must be last --ends in a flexible-array member. */ 5332 + struct statmount sm; 5331 5333 }; 5332 5334 5333 5335 static u64 mnt_to_attr_flags(struct vfsmount *mnt)
+7 -8
include/linux/iomap.h
··· 79 79 #define IOMAP_F_ATOMIC_BIO (1U << 8) 80 80 81 81 /* 82 + * Flag reserved for file system specific usage 83 + */ 84 + #define IOMAP_F_PRIVATE (1U << 12) 85 + 86 + /* 82 87 * Flags set by the core iomap code during operations: 83 88 * 84 89 * IOMAP_F_SIZE_CHANGED indicates to the iomap_end method that the file size ··· 93 88 * range it covers needs to be remapped by the high level before the operation 94 89 * can proceed. 95 90 */ 96 - #define IOMAP_F_SIZE_CHANGED (1U << 8) 97 - #define IOMAP_F_STALE (1U << 9) 98 - 99 - /* 100 - * Flags from 0x1000 up are for file system specific usage: 101 - */ 102 - #define IOMAP_F_PRIVATE (1U << 12) 103 - 91 + #define IOMAP_F_SIZE_CHANGED (1U << 14) 92 + #define IOMAP_F_STALE (1U << 15) 104 93 105 94 /* 106 95 * Magic value for addr:
+5 -6
kernel/exit.c
··· 268 268 leader = p->group_leader; 269 269 if (leader != p && thread_group_empty(leader) 270 270 && leader->exit_state == EXIT_ZOMBIE) { 271 + /* for pidfs_exit() and do_notify_parent() */ 272 + if (leader->signal->flags & SIGNAL_GROUP_EXIT) 273 + leader->exit_code = leader->signal->group_exit_code; 271 274 /* 272 275 * If we were the last child thread and the leader has 273 276 * exited already, and the leader's parent ignores SIGCHLD, ··· 759 756 kill_orphaned_pgrp(tsk->group_leader, NULL); 760 757 761 758 tsk->exit_state = EXIT_ZOMBIE; 762 - /* 763 - * Ignore thread-group leaders that exited before all 764 - * subthreads did. 765 - */ 766 - if (!delay_group_leader(tsk)) 767 - do_notify_pidfd(tsk); 768 759 769 760 if (unlikely(tsk->ptrace)) { 770 761 int sig = thread_group_leader(tsk) && ··· 771 774 do_notify_parent(tsk, tsk->exit_signal); 772 775 } else { 773 776 autoreap = true; 777 + /* untraced sub-thread */ 778 + do_notify_pidfd(tsk); 774 779 } 775 780 776 781 if (autoreap) {
+3 -5
kernel/signal.c
··· 2180 2180 2181 2181 WARN_ON_ONCE(!tsk->ptrace && 2182 2182 (tsk->group_leader != tsk || !thread_group_empty(tsk))); 2183 - /* 2184 - * Notify for thread-group leaders without subthreads. 2185 - */ 2186 - if (thread_group_empty(tsk)) 2187 - do_notify_pidfd(tsk); 2183 + 2184 + /* ptraced, or group-leader without sub-threads */ 2185 + do_notify_pidfd(tsk); 2188 2186 2189 2187 if (sig != SIGCHLD) { 2190 2188 /*
+1 -1
tools/testing/selftests/clone3/clone3_selftests.h
··· 16 16 #define ptr_to_u64(ptr) ((__u64)((uintptr_t)(ptr))) 17 17 18 18 #ifndef __NR_clone3 19 - #define __NR_clone3 -1 19 + #define __NR_clone3 435 20 20 #endif 21 21 22 22 struct __clone_args {
+4 -4
tools/testing/selftests/pidfd/pidfd.h
··· 32 32 #endif 33 33 34 34 #ifndef __NR_pidfd_open 35 - #define __NR_pidfd_open -1 35 + #define __NR_pidfd_open 434 36 36 #endif 37 37 38 38 #ifndef __NR_pidfd_send_signal 39 - #define __NR_pidfd_send_signal -1 39 + #define __NR_pidfd_send_signal 424 40 40 #endif 41 41 42 42 #ifndef __NR_clone3 43 - #define __NR_clone3 -1 43 + #define __NR_clone3 435 44 44 #endif 45 45 46 46 #ifndef __NR_pidfd_getfd 47 - #define __NR_pidfd_getfd -1 47 + #define __NR_pidfd_getfd 438 48 48 #endif 49 49 50 50 #ifndef PIDFD_NONBLOCK