From: Izaac Chong <izaacchong934@gmail.com>
To: Breno Leitao <leitao@debian.org>,
Andreas Hindborg <a.hindborg@kernel.org>,
Al Viro <viro@zeniv.linux.org.uk>
Cc: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
syzbot+b0996ac2197dd7420c3e@syzkaller.appspotmail.com,
linux-nvme@lists.infradead.org,
Izaac Chong <izaacchong934@gmail.com>
Subject: [PATCH v2 0/2] configfs: fix use-after-free races in configfs_symlink()
Date: Sat, 14 Nov 2026 13:29:45 +0800 [thread overview]
Message-ID: <20261114-configfs-symlink-uaf-v2-0-48c9cf068a91@gmail.com> (raw)
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@gmail.com>
next reply other threads:[~2026-11-14 5:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-14 5:29 Izaac Chong [this message]
2026-11-14 5:29 ` [PATCH v2 1/2] configfs: fix use-after-free of default group " Izaac Chong
2026-11-14 5:29 ` [PATCH v2 2/2] configfs: pin symlink target against rmdir before ->allow_link() Izaac Chong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261114-configfs-symlink-uaf-v2-0-48c9cf068a91@gmail.com \
--to=izaacchong934@gmail.com \
--cc=a.hindborg@kernel.org \
--cc=leitao@debian.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=linux-usb@vger.kernel.org \
--cc=syzbot+b0996ac2197dd7420c3e@syzkaller.appspotmail.com \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®