summaryrefslogtreecommitdiff
path: root/scripts/basic/split-include.c
diff options
context:
space:
mode:
authorYizhou Zhao <zhaoyz24@mails.tsinghua.edu.cn>2026-05-29 16:18:16 +0800
committerDominique Martinet <asmadeus@codewreck.org>2026-09-13 08:25:26 +0000
commit0955472fff1e9f9e410a0300136924ebc8bd7a16 (patch)
tree23b4386f655769600ccffdb77d2b7b4538046111 /scripts/basic/split-include.c
parent7fb9bd3659051ff74a29387de0023bb8300e4aa7 (diff)
downloadlinux-0955472fff1e9f9e410a0300136924ebc8bd7a16.tar.gz
linux-0955472fff1e9f9e410a0300136924ebc8bd7a16.zip
net/9p/usbg: fix descriptor cleanup use-after-free
usb9pfs_free_func() frees the f_usb9pfs object before calling usb_free_all_descriptors(). The usb_function passed to the latter is embedded in the freed object, so removing the function from a gadget dereferences freed memory. The failing teardown sequence is: configfs unlink usb9pfs_free_func() kfree(usb9pfs) usb_free_all_descriptors(f) dereference the embedded usb_function KASAN reported: BUG: KASAN: slab-use-after-free in usb_free_all_descriptors+0x138/0x190 Read of size 8 at addr ffff888106a73088 by task poc/95 Call Trace: usb_free_all_descriptors+0x138/0x190 config_usb_cfg_unlink+0x1f0/0x2f0 configfs_unlink+0x321/0x6f0 Free the descriptors before freeing their containing object. Fixes: a3be076dc174 ("net/9p/usbg: Add new usb gadget function transport") Reported-by: Yizhou Zhao <zhaoyz24@mails.tsinghua.edu.cn> Reported-by: Yuxiang Yang <yangyx22@mails.tsinghua.edu.cn> Reported-by: Ao Wang <wangao@seu.edu.cn> Reported-by: Xuewei Feng <fengxw06@126.com> Reported-by: Qi Li <qli01@tsinghua.edu.cn> Reported-by: Ke Xu <xuke@tsinghua.edu.cn> Assisted-by: GLM:GLM-5.1 Signed-off-by: Yizhou Zhao <zhaoyz24@mails.tsinghua.edu.cn> Co-developed-by: Chengfeng Ye <nicoyip.dev@gmail.com> Signed-off-by: Chengfeng Ye <nicoyip.dev@gmail.com> Acked-by: Michael Grzeschik <mgr@kernel.org> Message-ID: <20260529081817.77898-1-zhaoyz24@mails.tsinghua.edu.cn> Message-ID: <20260731150414.3135662-1-nicoyip.dev@gmail.com> Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
Diffstat (limited to 'scripts/basic/split-include.c')
0 files changed, 0 insertions, 0 deletions