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
afs treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
autofs
befs
bfs
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
debugfs
devpts
dlm
ecryptfs
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
exportfs
ext2
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
hfs treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
hfsplus
hostfs
hpfs
hugetlbfs
iomap
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
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
nls
notify
ntfs treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
ntfs3
ocfs2 mm.git review status for master..mm-nonmm-stable 2026-08-23 08:07:11 -07:00
omfs
openpromfs
orangefs
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
ramfs mm.git review status for linus..mm-stable 2026-08-27 09:17:06 -07:00
resctrl
romfs
smb treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
squashfs
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
ufs
unicode
vboxsf
verity
xfs treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
zonefs
aio.c
anon_inodes.c
attr.c
backing-file.c
bad_inode.c
binfmt_elf_fdpic.c
binfmt_elf.c
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
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
dcache.c
direct-io.c
drop_caches.c
eventfd.c
eventpoll.c
exec.c
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
fserror.c
fsopen.c
init.c
inode.c
internal.h
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
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
sync.c
sysctls.c
timerfd.c
utimes.c
xattr.c