[PATCH v2 0/2] configfs: fix use-after-free races in configfs_symlink()

From: Izaac Chong

Date: Sat Nov 14 2026 - 00:30:14 EST


configfs_symlink() drops the parent directory's lock while it resolves
the link target. Two races in that window are fixed here:

1/2 fixes a use-after-free when the parent is a default group whose
containing object is freed by a concurrent rmdir (syzbot,
nvmet_port_subsys_allow_link).
2/2 pins the target against rmdir before ->allow_link(), so drivers
that walk the target's ->ci_parent do not see it unlinked
(NULL deref in uvcg_streaming_header_allow_link). Found by Sashiko
review of v1.

Changes in v2:
- Add patch 2/2. Patch 1/2 is unchanged.

Testing (QEMU + KASAN, v7.4-rc2): the syzbot
reproducer crashes without 1/2; a UVC symlink-vs-rmdir reproducer
crashes without 2/2 (with 1/2 applied). With both patches, both
reproducers plus an nvmet target-side race run clean, normal
link/unlink/rmdir still work, and rmdir of a linked target still
returns -EBUSY. syzbot #syz test is currently disabled.

Not tested: lockdep was off; LIO (target_fabric_mappedlun_link) was not
exercised.

---
Izaac Chong (2):
configfs: fix use-after-free of default group in configfs_symlink()
configfs: pin symlink target against rmdir before ->allow_link()

fs/configfs/symlink.c | 66 +++++++++++++++++++++++++++++++++++----------------
1 file changed, 46 insertions(+), 20 deletions(-)
---
base-commit: 97d73c8251226cf27cc6656b4c542869bb8c69fa
change-id: 20261114-configfs-symlink-uaf-c5d84bb6a976

Best regards,
--
Izaac Chong <izaacchong934@xxxxxxxxx>