Vulnerability · Published Aug 21, 2024 · Assigned by Linux
CVE-2022-48869USB: gadgetfs: Fix race between mounting and unmounting
Medium 4.7
In plain English
A medium-severity security flaw in Linux from Linux. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.2% (higher than 14% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
In the Linux kernel, the following vulnerability has been resolved: USB: gadgetfs: Fix race between mounting and unmounting The syzbot fuzzer and Gerald Lee have identified a use-after-free bug in the gadgetfs driver, involving processes concurrently mounting and unmounting the gadgetfs filesystem. In particular, gadgetfs_fill_super() can race with gadgetfs_kill_sb(), causing the latter to deallocate the_device while the former is using it. The output from KASAN says, in part: BUG: KASAN: use-after-free in instrument_atomic_read_write include/linux/instrumented.h:102 [inline] BUG: KASAN: use-after-free in atomic_fetch_sub_release include/linux/atomic/atomic-instrumented.h:176 [inline] BUG: KASAN: use-after-free in __refcount_sub_and_test include/linux/refcount.h:272 [inline] BUG: KASAN: use-after-free in __refcount_dec_and_test include/linux/refcount.h:315 [inline] BUG: KASAN: use-after-free in refcount_dec_and_test include/linux/refcount.h:333 [inline] BUG: KASAN: use-after-free in put_dev drivers/usb/gadget/legacy/inode.c:159 [inline] BUG: KASAN: use-after-free in gadgetfs_kill_sb+0x33/0x100 drivers/usb/gadget/legacy/inode.c:2086 Write of size 4 at addr ffff8880276d7840 by task syz-executor126/18689 CPU: 0 PID: 18689 Comm: syz-executor126 Not tainted 6.1.0-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Call Trace: <TASK> ... atomic_fetch_sub_release include/linux/atomic/atomic-instrumented.h:176 [inline] __refcount_sub_and_test include/linux/refcount.h:272 [inline] __refcount_dec_and_test include/linux/refcount.h:315 [inline] refcount_dec_and_test include/linux/refcount.h:333 [inline] put_dev drivers/usb/gadget/legacy/inode.c:159 [inline] gadgetfs_kill_sb+0x33/0x100 drivers/usb/gadget/legacy/inode.c:2086 deactivate_locked_super+0xa7/0xf0 fs/super.c:332 vfs_get_super fs/super.c:1190 [inline] get_tree_single+0xd0/0x160 fs/super.c:1207 vfs_get_tree+0x88/0x270 fs/super.c:1531 vfs_fsconfig_locked fs/fsopen.c:232 [inline] The simplest solution is to ensure that gadgetfs_fill_super() and gadgetfs_kill_sb() are serialized by making them both acquire a new mutex.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:12 | linux | 6.1.8-1 | DEBIAN-CVE-2022-48869 |
| Debian:13 | linux | 6.1.8-1 | DEBIAN-CVE-2022-48869 |
| Debian:14 | linux | 6.1.8-1 | DEBIAN-CVE-2022-48869 |
| Ubuntu:22.04:LTS | linux | 5.15.0-69.76 | UBUNTU-CVE-2022-48869 |
| Ubuntu:22.04:LTS | linux-allwinner-5.19 | no fix listed | UBUNTU-CVE-2022-48869 |
| Ubuntu:22.04:LTS | linux-aws | 5.15.0-1033.37 | UBUNTU-CVE-2022-48869 |
| Ubuntu:22.04:LTS | linux-aws-5.19 | no fix listed | UBUNTU-CVE-2022-48869 |
| Ubuntu:22.04:LTS | linux-aws-6.2 | no fix listed | UBUNTU-CVE-2022-48869 |
| Ubuntu:22.04:LTS | linux-aws-6.5 | no fix listed | UBUNTU-CVE-2022-48869 |
| Ubuntu:22.04:LTS | linux-azure | 5.15.0-1035.42 | UBUNTU-CVE-2022-48869 |
| Ubuntu:22.04:LTS | linux-azure-5.19 | no fix listed | UBUNTU-CVE-2022-48869 |
| Ubuntu:22.04:LTS | linux-azure-6.2 | no fix listed | UBUNTU-CVE-2022-48869 |
| Ubuntu:22.04:LTS | linux-azure-6.5 | no fix listed | UBUNTU-CVE-2022-48869 |
| Ubuntu:22.04:LTS | linux-azure-fde | 5.15.0-1035.42.1 | UBUNTU-CVE-2022-48869 |
| Ubuntu:22.04:LTS | linux-azure-fde-5.19 | no fix listed | UBUNTU-CVE-2022-48869 |
| Ubuntu:22.04:LTS | linux-azure-fde-6.2 | no fix listed | UBUNTU-CVE-2022-48869 |
| Ubuntu:22.04:LTS | linux-gcp | 5.15.0-1031.38 | UBUNTU-CVE-2022-48869 |
| Ubuntu:22.04:LTS | linux-gcp-5.19 | no fix listed | UBUNTU-CVE-2022-48869 |
| Ubuntu:22.04:LTS | linux-gcp-6.2 | no fix listed | UBUNTU-CVE-2022-48869 |
| Ubuntu:22.04:LTS | linux-gcp-6.5 | no fix listed | UBUNTU-CVE-2022-48869 |
| Ubuntu:22.04:LTS | linux-gke | 5.15.0-1030.35 | UBUNTU-CVE-2022-48869 |
| Ubuntu:22.04:LTS | linux-gkeop | 5.15.0-1017.22 | UBUNTU-CVE-2022-48869 |
| Ubuntu:22.04:LTS | linux-hwe-5.19 | no fix listed | UBUNTU-CVE-2022-48869 |
| Ubuntu:22.04:LTS | linux-hwe-6.2 | no fix listed | UBUNTU-CVE-2022-48869 |
| Ubuntu:22.04:LTS | linux-hwe-6.5 | no fix listed | UBUNTU-CVE-2022-48869 |
| Ubuntu:22.04:LTS | linux-ibm | 5.15.0-1027.30 | UBUNTU-CVE-2022-48869 |
| Ubuntu:22.04:LTS | linux-intel-iotg | 5.15.0-1027.32 | UBUNTU-CVE-2022-48869 |
| Ubuntu:22.04:LTS | linux-kvm | 5.15.0-1030.35 | UBUNTU-CVE-2022-48869 |
| Ubuntu:22.04:LTS | linux-lowlatency | 5.15.0-69.76 | UBUNTU-CVE-2022-48869 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-5.19 | no fix listed | UBUNTU-CVE-2022-48869 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.2 | no fix listed | UBUNTU-CVE-2022-48869 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.5 | no fix listed | UBUNTU-CVE-2022-48869 |
| Ubuntu:22.04:LTS | linux-nvidia | 5.15.0-1023.23 | UBUNTU-CVE-2022-48869 |
| Ubuntu:22.04:LTS | linux-nvidia-6.2 | no fix listed | UBUNTU-CVE-2022-48869 |
| Ubuntu:22.04:LTS | linux-oem-5.17 | no fix listed | UBUNTU-CVE-2022-48869 |
| Ubuntu:22.04:LTS | linux-oem-6.0 | no fix listed | UBUNTU-CVE-2022-48869 |
| Ubuntu:22.04:LTS | linux-oem-6.1 | no fix listed | UBUNTU-CVE-2022-48869 |
| Ubuntu:22.04:LTS | linux-oem-6.5 | no fix listed | UBUNTU-CVE-2022-48869 |
| Ubuntu:22.04:LTS | linux-oracle | 5.15.0-1032.38 | UBUNTU-CVE-2022-48869 |
| Ubuntu:22.04:LTS | linux-oracle-6.5 | no fix listed | UBUNTU-CVE-2022-48869 |
| Ubuntu:22.04:LTS | linux-raspi | 5.15.0-1026.28 | UBUNTU-CVE-2022-48869 |
| Ubuntu:24.04:LTS | linux-raspi-realtime | no fix listed | UBUNTU-CVE-2022-48869 |
| Ubuntu:22.04:LTS | linux-realtime | no fix listed | UBUNTU-CVE-2022-48869 |
| Ubuntu:22.04:LTS | linux-riscv | no fix listed | UBUNTU-CVE-2022-48869 |
| Ubuntu:22.04:LTS | linux-riscv-5.19 | no fix listed | UBUNTU-CVE-2022-48869 |
| Ubuntu:22.04:LTS | linux-riscv-6.5 | no fix listed | UBUNTU-CVE-2022-48869 |
| Ubuntu:22.04:LTS | linux-starfive-5.19 | no fix listed | UBUNTU-CVE-2022-48869 |
| Ubuntu:22.04:LTS | linux-starfive-6.2 | no fix listed | UBUNTU-CVE-2022-48869 |
| Ubuntu:22.04:LTS | linux-starfive-6.5 | no fix listed | UBUNTU-CVE-2022-48869 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| Linux | Linux | e5d82a7360d124ae1a38c2a5eac92ba49b125191 – before 9a39f4626b361ee7aa10fd990401c37ec3b466aee5d82a7360d124ae1a38c2a5eac92ba49b125191 – before 856e4b5e53f21edbd15d275dde62228dd94fb2b4e5d82a7360d124ae1a38c2a5eac92ba49b125191 – before a2e075f40122d8daf587db126c562a67abd69cf9e5d82a7360d124ae1a38c2a5eac92ba49b125191 – before 616fd34d017000ecf9097368b13d8a266f4920b3e5d82a7360d124ae1a38c2a5eac92ba49b125191 – before d18dcfe9860e842f394e37ba01ca9440ab2178f4 |
| Linux | Linux | 5.3 |
References
- https://git.kernel.org/stable/c/9a39f4626b361ee7aa10fd990401c37ec3b466ae
- https://git.kernel.org/stable/c/856e4b5e53f21edbd15d275dde62228dd94fb2b4
- https://git.kernel.org/stable/c/a2e075f40122d8daf587db126c562a67abd69cf9
- https://git.kernel.org/stable/c/616fd34d017000ecf9097368b13d8a266f4920b3
- https://git.kernel.org/stable/c/d18dcfe9860e842f394e37ba01ca9440ab2178f4