[GIT PULL for v7.4] vfs fixes

From: Christian Brauner

Date: Sun Nov 22 2026 - 09:42:35 EST


Hey Linus,

/* Summary */

This contains fixes for the current development cycle.

This contains the procfs fixes from the procfs rework I've been doing.
I've mentioned this on the list. If you'd rather take the fixes during
the merge window, let me know:

Fix a lot of old bugs in procfs and in /proc handlers all over the
tree. They turned up while reviewing just about every ->proc_read(),
->proc_write() and ->proc_ioctl() for moving procfs to what kernfs
does.

* Resume readdir after the last name it returned instead of at a
counted position for both /proc and /proc/sys.

An entry that was added or removed between two getdents64() calls
made caused one entry to be repated or skipped. /proc/sys readdir
now also skips an entry that is being unregistered instead of
reporting end of the directory.

* Don't hold the sysctl table while read(), write() and getdents64()
of /proc/sys copy to or from userspace, and don't pin a /proc
symlink's entry while readlink() copies it out. A copy that faults
for as long as userspace wants held up unregister_sysctl_table() or
remove_proc_entry(), whose callers hold locks such as RTNL in
addrconf and snd_card_mutex in ALSA.

* Treat a non-directory like a missing directory when resolving a
name.

* make pktgen refuse device names with a '/' or that are taken

* make pktgen let go of a renamed device when it is unregistered
instead of leaving unregister_netdevice() waiting forever

* Queue the pollers of the sunrpc channel files on a single static
wait queue again to fix a uaf.

* Refuse to map procfs files on NOMMU.

* Bound the lengths of the esas2r HBA, SMP and firmware ioctls by the
struct they were copied into and stop copying kernel pointers out.

* Keep the position of the PCI and isapnp config space files in a
loff_t.

* Remove /proc/driver/rtc before taking ops_lock.

* Let proc_remove() remove the entry it was given instead of whatever
has its name now.

* Fix the /proc handlers of ALSA, powerpc, xtensa, scsi, PNP, s390,
sparc, um, zorro, toshiba_acpi, libipw, lockd, ntfs3, psi and
profiling. Several of them read past or in front of their buffers,
handed out uninitialized or freed memory, dropped the last byte of a
write, consumed only part of one or returned 0 from it.

- fs: Stop resetting userspace_init_fs to nullfs when PID 1 stops
sharing it to fix an Android regression.

- ns: mark internal mount namespaces from mount_subtree() so they're not
denied.

- nfs: Reintroduce SB_I_MULTIROOT and raise it again on the superblocks
nfs may share between mounts of disjoint subtrees. The flag was lost
in the conversion to the new mount api in v5.6 and removed as unused
in v5.10. So ".." could walk out of an NFSv2/NFSv3 mount and out of a
chroot again once a directory was moved into the other mount's
subtree.

- fhandle: Only warn in vfs_dentry_acceptable() when the walk up from a
decoded directory ends at a disconnected dentry.

- cachefiles: Size the buffer in cachefiles_preset_object_xattr() with
max() instead of min().

- ext4: Remember the file before submitting a direct read instead of
taking it from the kiocb afterwards.

- signal: Walk the threads in complete_signal() with
list_next_entry_circular() instead of next_thread().

- iomap: Cast the page index to loff_t before shifting it in
iomap_fill_dirty_folios().

- xattr: Require the inode owner or CAP_FOWNER to write user.* xattrs on
sockets.

- devpts: Create pty nodes with simple_start_creating() under the inode
lock of the devpts root, like mknod_ptmx() does.

- kernfs: Clear i_nlink of a removed node's inodes before deactivating
the node. A lookup that killed the dentry in between still saw i_nlink
at 1, so inotify never sent IN_DELETE_SELF.

- fork: Call copy_exec_state() right before copy_creds() again so it
can't fail before rt_mutex_init_task() reset the PI state copied from
the parent.

- iov_iter: Check the alignment of what iov_iter_extract_bvecs()
actually extracts.

- shmem: Let the remaining reservation instead of the current inode
limit decide whether shmem_initxattrs() consumes the space reserved
for an xattr.

- bdev: Report the block size as st_blksize when it is larger than the
minimum I/O size.

- fuse: Add IOP_SET_ACL_OWNER_CHECK so fuse_set_acl() can do the ACL
owner check itself and skip it without default_permissions.

- stat: Reject unsupported flags such as AT_RECURSIVE in the
AT_EMPTY_PATH fast paths of fstatat() and statx().

- exit: Read mm->owner with READ_ONCE() in mm_update_next_owner() to
match the WRITE_ONCE() on the other side.

- pipe: Annotate the lockless checks of pipe->files in pipe_lock() and
pipe_unlock() for KCSAN.

/* Conflicts */

Merge conflicts with mainline
=============================

No known conflicts.

Merge conflicts with other trees
================================

No known conflicts.

The following changes since commit 7e1392a42ea288d70a266f6553fe06f57f8647ea:

Merge tag 'net-7.4-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net (2026-11-12 12:26:14 -0800)

are available in the Git repository at:

git@xxxxxxxxxxxxxxxxxxx:pub/scm/linux/kernel/git/vfs/vfs tags/vfs-7.4-rc4.fixes

for you to fetch changes up to d5b84d3d7e902c44b05b106718c579f3d3834812:

ext4: don't use the kiocb after a direct read was queued (2026-11-22 11:24:12 +0100)

----------------------------------------------------------------
vfs-7.4-rc4.fixes

Please consider pulling these changes from the signed vfs-7.4-rc4.fixes tag.

Thanks!
Christian

----------------------------------------------------------------
Andrew Morton (1):
shmem: consume the reserved xattr space despite remount

Avi Weiss (1):
fs/stat: reject invalid flags for empty paths

Christian Aurich Zanettini Martins (1):
fork: Don't let copy_exec_state() fail before rt_mutex_init_task()

Christian Brauner (65):
scsi: esas2r: don't copy kernel pointers out in EXPRESS_IOCTL_GET_MOD_INFO
ALSA: cs46xx: hand the region to the region proc files
PNP: isapnp: don't go on when isapnp_cfg_begin() fails
xtensa: simdisk: remove the proc entry before the disk
powerpc/pseries: put the node that the ofdt property commands look up
lockd: don't hand out the terminator of nlm_end_grace
powerpc/pseries/lparcfg: don't drop the last byte of a write
profiling: report it when /proc/profile can't be created
zorro: size the proc files like what they serve
sparc: led: consume the whole write
powerpc/rtas: consume the whole write to /proc/powerpc/rtas/progress
sched/psi: don't drop the last byte of a trigger write
ALSA: info: keep what was written when a text entry's buffer grows
rtc: don't remove /proc/driver/rtc with ops_lock held
proc: sysctl: don't stop readdir at an entry that is being unregistered
PCI/proc: don't truncate the position of config space accesses
PNP: isapnp: don't read past the end of the buffer on a large pread()
s390/dasd: don't look in front of the buffer on an empty write
platform/x86: toshiba_acpi: reject malformed brightness and fan writes
xtensa: simdisk: don't read the file name without the lock
powerpc/rtas_flash: don't read past the validate message
powerpc/rtasd: zero the error log buffer
ALSA: info: don't write past the end of a data entry
scsi: BusLogic: don't return 0 from writes to the proc file
scsi: ips: don't return 0 from writes to the proc file
wifi: libipw: don't return 0 from writes to debug_level
scsi: core: NUL-terminate what is written to the host proc files
um: NUL-terminate what is written to /proc/exitcode
ntfs3: don't warn when a huge label is written
proc: don't walk through a non-directory when resolving a name
net: pktgen: reject device names with a '/'
net: pktgen: don't register a device file under a name that is taken
net: pktgen: let go of a renamed device when it is unregistered
proc: resume readdir after the last name it returned
selftests/proc: check a /proc listing while entries come and go
proc: let proc_remove() remove the entry it was given
proc: warn about entries left in /proc/net of a dying namespace
proc: don't let NOMMU map procfs files
proc/vmcore: don't let vmcore_cleanup() run twice at once
sunrpc: make queue_wait a global wait queue again
scsi: esas2r: bound the lengths of the HBA, SMP and firmware ioctls
powerpc/pseries: bound the lengths in the ofdt property parser
powerpc/pseries/lparcfg: return h_get_ppp()'s status as a long
proc: sysctl: resume readdir after the last name it returned
selftests/proc: check a sysctl listing while entries come and go
proc: sysctl: copy to and from userspace without holding the table
proc: sysctl: look at the table under sysctl_lock when creating an inode
proc: sysctl: don't hold the tables while readdir copies to userspace
selftests/proc: check that faulting sysctl accesses don't hold up removal
proc: don't pin a symlink's entry while readlink() copies it out
selftests/proc: check that a faulting readlink() doesn't hold up removal
Merge patch series "proc: fix a few old bugs in /proc handlers (Part 1/7)"
devpts: create pty nodes under the parent lock
cachefiles: fix buffer size in cachefiles_preset_object_xattr()
fs: reintroduce SB_I_MULTIROOT
fhandle: only warn about disconnected directories
Merge patch series "fs: reintroduce SB_I_MULTIROOT"
fs: let pivot_root() move userspace_init_fs when nobody shares it
fs: don't reset userspace_init_fs when PID 1 stops sharing it
Merge patch series "fs: don't reset userspace_init_fs when PID 1 stops sharing it"
mount: pass flags to alloc_mnt_ns()
ns: don't call the namespace LSM hooks for kernel-internal namespaces
Merge patch series "ns: don't call the namespace LSM hooks for kernel-internal namespaces"
kernfs: clear i_nlink before deactivating removed nodes
ext4: don't use the kiocb after a direct read was queued

Daehyeon Ko (1):
iov_iter: validate extracted segment for bvec alignment

Dominik Maier (1):
xattr: require inode owner or CAP_FOWNER to write user.* xattrs on sockets

Hengyu Liang (1):
bdev: do not report a statx block size below the block size

Hristos Nenkov (1):
fuse: preserve daemon-owned ACL permission decisions

Mani Tofigh (1):
exit: use READ_ONCE() to read mm->owner

Oleg Nesterov (1):
signal: fix lockup in complete_signal() racing with mt exec

Shashank Mohan Jain (1):
iomap: fix offset truncation in iomap_fill_dirty_folios() on 32-bit

Zhu Jun (1):
pipe: annotate lockless checks of the file count

arch/powerpc/kernel/rtas-proc.c | 3 +-
arch/powerpc/kernel/rtas_flash.c | 2 +-
arch/powerpc/kernel/rtasd.c | 2 +-
arch/powerpc/platforms/pseries/lparcfg.c | 7 +-
arch/powerpc/platforms/pseries/reconfig.c | 24 +-
arch/sparc/kernel/led.c | 3 +-
arch/um/kernel/exitcode.c | 3 +-
arch/xtensa/platforms/iss/simdisk.c | 28 +-
block/bdev.c | 6 +-
drivers/net/wireless/intel/ipw2x00/libipw_module.c | 2 +-
drivers/pci/proc.c | 22 +-
drivers/platform/x86/toshiba_acpi.c | 8 +-
drivers/pnp/isapnp/core.c | 16 +-
drivers/pnp/isapnp/proc.c | 11 +-
drivers/rtc/class.c | 3 +-
drivers/s390/block/dasd.c | 2 +-
drivers/scsi/BusLogic.c | 2 +-
drivers/scsi/esas2r/esas2r.h | 2 +-
drivers/scsi/esas2r/esas2r_ioctl.c | 48 ++-
drivers/scsi/esas2r/esas2r_main.c | 3 +-
drivers/scsi/ips.c | 2 +-
drivers/scsi/scsi_proc.c | 16 +-
drivers/zorro/proc.c | 2 +-
fs/cachefiles/xattr.c | 2 +-
fs/devpts/inode.c | 8 +-
fs/ext4/file.c | 6 +-
fs/fhandle.c | 5 +-
fs/fs_struct.c | 72 ++--
fs/fuse/acl.c | 9 +
fs/fuse/inode.c | 6 +
fs/iomap/buffered-io.c | 2 +-
fs/kernfs/dir.c | 12 +-
fs/lockd/procfs.c | 2 +-
fs/namei.c | 4 +-
fs/namespace.c | 31 +-
fs/nfs/super.c | 2 +
fs/ntfs3/super.c | 11 +-
fs/pipe.c | 4 +-
fs/posix_acl.c | 3 +-
fs/proc/generic.c | 164 +++++++--
fs/proc/inode.c | 38 +-
fs/proc/internal.h | 1 +
fs/proc/proc_net.c | 10 +
fs/proc/proc_sysctl.c | 394 ++++++++++++++-------
fs/proc/root.c | 1 +
fs/proc/vmcore.c | 5 +
fs/stat.c | 11 +-
fs/xattr.c | 10 +-
include/linux/fs.h | 2 +
include/linux/fs/super_types.h | 1 +
include/linux/ns/ns_common_types.h | 2 +
include/linux/ns_common.h | 20 +-
include/linux/sunrpc/cache.h | 1 -
kernel/exit.c | 2 +-
kernel/fork.c | 10 +-
kernel/nscommon.c | 9 +-
kernel/profile.c | 8 +-
kernel/sched/psi.c | 4 +-
kernel/signal.c | 3 +-
lib/iov_iter.c | 9 +-
mm/shmem.c | 2 +-
net/core/pktgen.c | 115 ++++--
net/sunrpc/cache.c | 12 +-
sound/core/info.c | 5 +
sound/isa/es18xx.c | 6 +-
sound/pci/cs46xx/cs46xx_lib.c | 2 +-
tools/testing/selftests/proc/.gitignore | 4 +
tools/testing/selftests/proc/Makefile | 4 +
tools/testing/selftests/proc/config | 9 +
tools/testing/selftests/proc/proc-readdir-churn.c | 333 +++++++++++++++++
.../selftests/proc/proc-remove-slow-readlink.c | 191 ++++++++++
.../selftests/proc/proc-remove-slow-sysctl.c | 215 +++++++++++
.../selftests/proc/proc-sysctl-readdir-churn.c | 152 ++++++++
73 files changed, 1740 insertions(+), 411 deletions(-)
create mode 100644 tools/testing/selftests/proc/proc-readdir-churn.c
create mode 100644 tools/testing/selftests/proc/proc-remove-slow-readlink.c
create mode 100644 tools/testing/selftests/proc/proc-remove-slow-sysctl.c
create mode 100644 tools/testing/selftests/proc/proc-sysctl-readdir-churn.c