CVE-2023-53138 Information
Description
In the Linux kernel the following vulnerability has been resolved:
net: caif: Fix use-after-free in cfusbl_device_notify()
syzbot reported use-after-free in cfusbl_device_notify() [1]. This causes a stack trace like below:
BUG: KASAN: use-after-free in cfusbl_device_notify+0x7c9/0x870 net/caif/caif_usb.c:138 Read of size 8 at addr ffff88807ac4e6f0 by task kworker/u4:6/1214
CPU: 0 PID: 1214 Comm: kworker/u4:6 Not tainted 5.19.0-rc3-syzkaller-00146-g92f20ff72066 0
Hardware name: Google Google Compute Engine/Google Compute Engine BIOS Google 01/01/2011
Workqueue: netns cleanup_net
Call Trace:
When unregistering a net device unregister_netdevice_many_notify() sets the device’s reg_state to NETREG_UNREGISTERING calls notifiers with NETDEV_UNREGISTER and adds the device to the todo list.
Later on devices in the todo list are processed by netdev_run_todo(). netdev_run_todo() waits devices’ reference count become 1 while rebdoadcasting NETDEV_UNREGISTER notification.
When cfusbl_device_notify() is called with NETDEV_UNREGISTER multiple times the parent device might be freed. This could cause UAF. Processing NETDEV_UNREGISTER multiple times also causes inbalance of reference count for the module.
This patch fixes the issue by accepting only first NETDEV_UNREGISTER notification.
Reference
https://git.kernel.org/stable/c/1793da97a23e31c5bf06631f3f3e5a25f368fd64 https://git.kernel.org/stable/c/287027d8a567168a5d8ce5cb0cba16a34791a48c https://git.kernel.org/stable/c/3f14457e1584224f4296af613bbd99deb60b5d91 https://git.kernel.org/stable/c/68a45c3cf0e2242a533657f4f535d9b6a7447a79 https://git.kernel.org/stable/c/9781e98a97110f5e76999058368b4be76a788484 https://git.kernel.org/stable/c/9dc16be373b382ddd4c274052a6e870a95e76c01 https://git.kernel.org/stable/c/c3aaec463a632cf4187dc017e421bfa69d7834a9 https://git.kernel.org/stable/c/d1a11bbdbb5ea9f172019c5a4a3e9d8eabd72179
Share on: