CVE-2022-49755

Severity CVSS v4.0:
Pending analysis
Type:
CWE-416 Use After Free
Publication date:
27/03/2025
Last modified:
01/04/2025

Description

In the Linux kernel, the following vulnerability has been resolved:<br /> <br /> usb: gadget: f_fs: Prevent race during ffs_ep0_queue_wait<br /> <br /> While performing fast composition switch, there is a possibility that the<br /> process of ffs_ep0_write/ffs_ep0_read get into a race condition<br /> due to ep0req being freed up from functionfs_unbind.<br /> <br /> Consider the scenario that the ffs_ep0_write calls the ffs_ep0_queue_wait<br /> by taking a lock &amp;ffs-&gt;ev.waitq.lock. However, the functionfs_unbind isn&amp;#39;t<br /> bounded so it can go ahead and mark the ep0req to NULL, and since there<br /> is no NULL check in ffs_ep0_queue_wait we will end up in use-after-free.<br /> <br /> Fix this by making a serialized execution between the two functions using<br /> a mutex_lock(ffs-&gt;mutex).

Vulnerable products and versions

CPE From Up to
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 2.6.35 (including) 4.14.305 (excluding)
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 4.15 (including) 4.19.272 (excluding)
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 4.20 (including) 5.4.231 (excluding)
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 5.5 (including) 5.10.166 (excluding)
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 5.11 (including) 5.15.91 (excluding)
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 5.16 (including) 6.1.9 (excluding)
cpe:2.3:o:linux:linux_kernel:6.2:rc1:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.2:rc2:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.2:rc3:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.2:rc4:*:*:*:*:*:*