CVE-2022-48801
Severity CVSS v4.0:
Pending analysis
Type:
CWE-416
Use After Free
Publication date:
16/07/2024
Last modified:
24/09/2025
Description
In the Linux kernel, the following vulnerability has been resolved:<br />
<br />
iio: buffer: Fix file related error handling in IIO_BUFFER_GET_FD_IOCTL<br />
<br />
If we fail to copy the just created file descriptor to userland, we<br />
try to clean up by putting back &#39;fd&#39; and freeing &#39;ib&#39;. The code uses<br />
put_unused_fd() for the former which is wrong, as the file descriptor<br />
was already published by fd_install() which gets called internally by<br />
anon_inode_getfd().<br />
<br />
This makes the error handling code leaving a half cleaned up file<br />
descriptor table around and a partially destructed &#39;file&#39; object,<br />
allowing userland to play use-after-free tricks on us, by abusing<br />
the still usable fd and making the code operate on a dangling<br />
&#39;file->private_data&#39; pointer.<br />
<br />
Instead of leaving the kernel in a partially corrupted state, don&#39;t<br />
attempt to explicitly clean up and leave this to the process exit<br />
path that&#39;ll release any still valid fds, including the one created<br />
by the previous call to anon_inode_getfd(). Simply return -EFAULT to<br />
indicate the error.
Impact
Base Score 3.x
7.80
Severity 3.x
HIGH
Vulnerable products and versions
| CPE | From | Up to |
|---|---|---|
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.13 (including) | 5.15.24 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.16 (including) | 5.16.10 (excluding) |
| cpe:2.3:o:linux:linux_kernel:5.17:rc1:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:5.17:rc2:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:5.17:rc3:*:*:*:*:*:* |
To consult the complete list of CPE names with products and versions, see this page
References to Advisories, Solutions, and Tools
- https://git.kernel.org/stable/c/202071d2518537866d291aa7cf26af54e674f4d4
- https://git.kernel.org/stable/c/b7f54894aa7517d2b6c797a499b9f491e9db9083
- https://git.kernel.org/stable/c/c72ea20503610a4a7ba26c769357d31602769c01
- https://git.kernel.org/stable/c/202071d2518537866d291aa7cf26af54e674f4d4
- https://git.kernel.org/stable/c/b7f54894aa7517d2b6c797a499b9f491e9db9083
- https://git.kernel.org/stable/c/c72ea20503610a4a7ba26c769357d31602769c01



