{"id":"CVE-2022-48801","published":"2024-07-16T11:43:54Z","modified":"2026-08-05T08:52:26Z","title":"iio: buffer: Fix file related error handling in IIO_BUFFER_GET_FD_IOCTL","vendor":"Linux","product":"Linux","tier":"tail","description":{"text":"In the Linux kernel, the following vulnerability has been resolved:\n\niio: buffer: Fix file related error handling in IIO_BUFFER_GET_FD_IOCTL\n\nIf we fail to copy the just created file descriptor to userland, we\ntry to clean up by putting back 'fd' and freeing 'ib'. The code uses\nput_unused_fd() for the former which is wrong, as the file descriptor\nwas already published by fd_install() which gets called internally by\nanon_inode_getfd().\n\nThis makes the error handling code leaving a half cleaned up file\ndescriptor table around and a partially destructed 'file' object,\nallowing userland to play use-after-free tricks on us, by abusing\nthe still usable fd and making the code operate on a dangling\n'file->private_data' pointer.\n\nInstead of leaving the kernel in a partially corrupted state, don't\nattempt to explicitly clean up and leave this to the process exit\npath that'll release any still valid fds, including the one created\nby the previous call to anon_inode_getfd(). Simply return -EFAULT to\nindicate the error.","provenance":"source","from":"CVE.org"},"cvss":{"score":7.8,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00286,"percentile":0.21615,"provenance":"source"},"cwes":[],"references":[{"url":"https://git.kernel.org/stable/c/b7f54894aa7517d2b6c797a499b9f491e9db9083","tags":[]},{"url":"https://git.kernel.org/stable/c/202071d2518537866d291aa7cf26af54e674f4d4","tags":[]},{"url":"https://git.kernel.org/stable/c/c72ea20503610a4a7ba26c769357d31602769c01","tags":[]}],"priority":{"score":9.8,"factors":[{"name":"EPSS percentile","points":4.32},{"name":"CVSS severity","points":5.46}]},"vendorSlug":"linux","affectedVersions":[{"vendor":"Linux","product":"Linux","versions":[">= f73f7f4da581875f9b1f2fb8ebd1ab15ed634488, < b7f54894aa7517d2b6c797a499b9f491e9db9083",">= f73f7f4da581875f9b1f2fb8ebd1ab15ed634488, < 202071d2518537866d291aa7cf26af54e674f4d4",">= f73f7f4da581875f9b1f2fb8ebd1ab15ed634488, < c72ea20503610a4a7ba26c769357d31602769c01"]},{"vendor":"Linux","product":"Linux","versions":["5.13"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial","timestamp":"2024-09-10T16:59:03.540562Z","from":"CISA ADP","provenance":"source"},"euvd":{"id":"EUVD-2022-53680","exploited":false,"provenance":"source"}}