linux/fs
Vasileios Almpanis f06c2d26d1 configfs: unhash the dentry before dropping the item in rmdir
configfs_get_config_item() treats a hashed dentry as proof that
sd->s_element is a live config_item.  configfs_rmdir() breaks that:
simple_rmdir() leaves the dentry hashed, the last reference to the item is
dropped right after, and the dentry is only unhashed by d_delete() once
->rmdir() has returned.  configfs_symlink() resolves its target holding no
lock on it, so get_target() can land in that window:

  BUG: KASAN: slab-use-after-free in config_item_get+0x26/0x90
   get_target fs/configfs/symlink.c:128 [inline]
   configfs_symlink+0x4ab/0x1030 fs/configfs/symlink.c:185

Unhash in configfs_remove_dir(), while the item is still guaranteed to be
there.  A reference obtained just before that stays harmless, as
create_link() rechecks CONFIGFS_USET_DROPPING, already set by
configfs_detach_prep().  Both configfs_unregister_subsystem() paths
d_drop() after detaching, so this only makes rmdir match them.

Reported-by: syzbot+6b16e3d085833cbf3e25@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=6b16e3d085833cbf3e25
Fixes: 7063fbf226 ("[PATCH] configfs: User-driven configuration filesystem")
Cc: stable@vger.kernel.org
Signed-off-by: Vasileios Almpanis <vasilisalmpanis@gmail.com>
Tested-by: Breno Leitao <leitao@debian.org>
Reviewed-by: Breno Leitao <leitao@debian.org>
Link: https://patch.msgid.link/20260730093435.195441-3-vasilisalmpanis@gmail.com
Signed-off-by: Breno Leitao <leitao@debian.org>
2026-09-07 09:15:05 -07:00
..
9p treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
adfs
affs vfs-7.3-rc1.sync 2026-08-17 14:21:00 -07:00
afs treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
autofs
befs
bfs vfs-7.3-rc1.sync 2026-08-17 14:21:00 -07:00
btrfs for-7.3-rc1-tag 2026-09-05 10:18:21 -07:00
cachefiles
ceph kmalloc_obj conversions for v7.3-rc2 2026-09-05 20:45:18 -07:00
coda
configfs configfs: unhash the dentry before dropping the item in rmdir 2026-09-07 09:15:05 -07:00
cramfs
crypto fscrypt updates for 7.3 2026-08-17 19:04:16 -07:00
debugfs
devpts
dlm
ecryptfs eCryptfs updates for 7.3-rc1 2026-08-21 12:32:01 -07:00
efivarfs EFI updates for v7.3 2026-08-23 09:24:34 -07:00
erofs Changes since last update: 2026-08-25 12:27:41 -07:00
exfat This contains a set of nine exfat fixes covering shared writable mappings, 2026-08-22 08:57:28 -07:00
exportfs
ext2 \n 2026-08-20 12:52:35 -07:00
ext4 treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
f2fs f2fs-for-7.3-rc1 2026-08-28 10:48:48 -07:00
fat mm.git review status for master..mm-nonmm-stable 2026-08-23 08:07:11 -07:00
fuse treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
gfs2 gfs2 changes 2026-08-17 17:03:34 -07:00
hfs treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
hfsplus hfs/hfsplus updates for v7.3 2026-08-17 18:14:32 -07:00
hostfs
hpfs
hugetlbfs mm.git review status for mm-hotfixes-stable..mm-stable 2026-08-20 18:17:08 -07:00
iomap for-7.3/block-20260819 2026-08-20 13:55:16 -07:00
isofs
jbd2
jffs2
jfs
kernfs kernfs: preserve security xattrs without allocating iattrs 2026-09-01 17:11:19 +02:00
lockd NFS client updates for Linux 7.3 2026-08-26 15:09:21 -07:00
minix vfs-7.3-rc1.sync 2026-08-17 14:21:00 -07:00
netfs
nfs mm.git review status for linus..mm-stable 2026-08-27 09:17:06 -07:00
nfs_common
nfsd treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
nilfs2 nilfs2 updates for v7.3 2026-08-17 18:34:43 -07:00
nls
notify
ntfs treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
ntfs3 Changes for 7.3-rc1 2026-08-20 12:27:02 -07:00
ocfs2 mm.git review status for master..mm-nonmm-stable 2026-08-23 08:07:11 -07:00
omfs
openpromfs
orangefs Fixes: 2026-08-20 12:36:26 -07:00
overlayfs treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
proc mm.git review status for linus..mm-stable 2026-08-27 09:17:06 -07:00
pstore
qnx4
qnx6
quota quota: Don't issue audit messages on quota enforcing 2026-08-21 09:09:54 +02:00
ramfs mm.git review status for linus..mm-stable 2026-08-27 09:17:06 -07:00
resctrl
romfs vfs-7.3-rc1.super 2026-08-17 13:57:04 -07:00
smb treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
squashfs squashfs: avoid thundering-herd cache wakeups 2026-08-19 19:55:06 -07:00
sysfs
tests
tracefs eventfs: Initialize ei->children and ei->list in init_ei() 2026-08-24 16:42:57 -04:00
ubifs This pull request contains updates for UBI and UBIFS: 2026-08-28 10:59:07 -07:00
udf \n 2026-08-20 12:52:35 -07:00
ufs
unicode
vboxsf
verity
xfs treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
zonefs
aio.c mm.git review status for mm-hotfixes-stable..mm-stable 2026-08-20 18:17:08 -07:00
anon_inodes.c
attr.c
backing-file.c
bad_inode.c
binfmt_elf_fdpic.c
binfmt_elf.c mm.git review status for mm-hotfixes-stable..mm-stable 2026-08-20 18:17:08 -07:00
binfmt_flat.c
binfmt_misc_bpf.c
binfmt_misc.c treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
binfmt_script.c
bpf_fs_kfuncs.c
buffer.c for-7.3/block-20260819 2026-08-20 13:55:16 -07:00
char_dev.c
compat_binfmt_elf.c
coredump.c treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
d_path.c
dax.c mm.git review status for mm-hotfixes-stable..mm-stable 2026-08-20 18:17:08 -07:00
dcache.c
direct-io.c
drop_caches.c
eventfd.c
eventpoll.c
exec.c Miscellaneous futex fixes: 2026-08-22 16:29:20 -07:00
failfs.c
fcntl.c
fhandle.c
file_attr.c
file_table.c
file.c
filesystems.c
fs_context.c
fs_dirent.c
fs_parser.c
fs_pin.c
fs_struct.c
fs-writeback.c for-7.3/block-20260819 2026-08-20 13:55:16 -07:00
fserror.c
fsopen.c
init.c
inode.c
internal.h vfs-7.3-rc1.super 2026-08-17 13:57:04 -07:00
ioctl.c
Kconfig
Kconfig.binfmt
kernel_read_file.c
libfs.c
locks.c
Makefile
mbcache.c
mnt_idmapping.c
mount.h
mpage.c
namei.c
namespace.c treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
nsfs.c
nullfs.c
open.c
pidfs.c
pipe.c Summary 2026-08-20 08:46:41 -07:00
pnode.c
pnode.h
posix_acl.c
proc_namespace.c
read_write.c
readdir.c
remap_range.c
select.c
seq_file.c
signalfd.c
splice.c
stack.c
stat.c
statfs.c
super.c vfs-7.3-rc1.super 2026-08-17 13:57:04 -07:00
sync.c
sysctls.c
timerfd.c
utimes.c
xattr.c