{"id":"CVE-2022-48801","sourceIdentifier":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","published":"2024-07-16T12:15:04.630","lastModified":"2026-08-04T10:17:22.277","vulnStatus":"Modified","cveTags":[],"descriptions":[{"lang":"en","value":"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."},{"lang":"es","value":"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: iio: buffer: corrige el manejo de errores relacionados con archivos en IIO_BUFFER_GET_FD_IOCTL Si no logramos copiar el descriptor de archivo recién creado en la zona de usuario, intentamos limpiar colocando de nuevo 'fd' y liberando ' ib'. El código usa put_unused_fd() para el primero, lo cual es incorrecto, ya que el descriptor de archivo ya fue publicado por fd_install(), que es llamado internamente por anon_inode_getfd(). Esto hace que el código de manejo de errores deje una tabla de descriptores de archivos medio limpia y un objeto 'archivo' parcialmente destruido, lo que permite que Userland nos juegue trucos de use-after-free, abusando del fd aún utilizable y haciendo que el código funcione en un puntero 'archivo-&gt;datos_privados' colgando. En lugar de dejar el kernel en un estado parcialmente dañado, no intente limpiar explícitamente y dejar esto en la ruta de salida del proceso que liberará cualquier fds aún válido, incluido el creado por la llamada anterior a anon_inode_getfd(). Simplemente devuelva -EFAULT para indicar el error."}],"affected":[{"source":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","affectedData":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","programFiles":["drivers/iio/industrialio-buffer.c"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","versions":[{"version":"f73f7f4da581875f9b1f2fb8ebd1ab15ed634488","lessThan":"b7f54894aa7517d2b6c797a499b9f491e9db9083","versionType":"git","status":"affected"},{"version":"f73f7f4da581875f9b1f2fb8ebd1ab15ed634488","lessThan":"202071d2518537866d291aa7cf26af54e674f4d4","versionType":"git","status":"affected"},{"version":"f73f7f4da581875f9b1f2fb8ebd1ab15ed634488","lessThan":"c72ea20503610a4a7ba26c769357d31602769c01","versionType":"git","status":"affected"}]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","programFiles":["drivers/iio/industrialio-buffer.c"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","versions":[{"version":"5.13","status":"affected"},{"version":"0","lessThan":"5.13","versionType":"semver","status":"unaffected"},{"version":"5.15.24","lessThanOrEqual":"5.15.*","versionType":"semver","status":"unaffected"},{"version":"5.16.10","lessThanOrEqual":"5.16.*","versionType":"semver","status":"unaffected"},{"version":"5.17","lessThanOrEqual":"*","versionType":"original_commit_for_fix","status":"unaffected"}]}]}],"metrics":{"cvssMetricV31":[{"source":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","type":"Secondary","cvssData":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","baseScore":7.8,"baseSeverity":"HIGH","attackVector":"LOCAL","attackComplexity":"LOW","privilegesRequired":"LOW","userInteraction":"NONE","scope":"UNCHANGED","confidentialityImpact":"HIGH","integrityImpact":"HIGH","availabilityImpact":"HIGH"},"exploitabilityScore":1.8,"impactScore":5.9},{"source":"nvd@nist.gov","type":"Primary","cvssData":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","baseScore":7.8,"baseSeverity":"HIGH","attackVector":"LOCAL","attackComplexity":"LOW","privilegesRequired":"LOW","userInteraction":"NONE","scope":"UNCHANGED","confidentialityImpact":"HIGH","integrityImpact":"HIGH","availabilityImpact":"HIGH"},"exploitabilityScore":1.8,"impactScore":5.9}],"ssvcV203":[{"source":"134c704f-9b21-4f2e-91b3-4a467353bcc0","ssvcData":{"timestamp":"2024-09-10T16:59:03.540562Z","id":"CVE-2022-48801","options":[{"exploitation":"none"},{"automatable":"no"},{"technicalImpact":"partial"}],"role":"CISA Coordinator","version":"2.0.3"}}]},"weaknesses":[{"source":"nvd@nist.gov","type":"Primary","description":[{"lang":"en","value":"CWE-416"}]}],"configurations":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.13","versionEndExcluding":"5.15.24","matchCriteriaId":"61670291-2496-4A61-A6FB-88E2748A3D89"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.16","versionEndExcluding":"5.16.10","matchCriteriaId":"679523BA-1392-404B-AB85-F5A5408B1ECC"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:5.17:rc1:*:*:*:*:*:*","matchCriteriaId":"7BD5F8D9-54FA-4CB0-B4F0-CB0471FDDB2D"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:5.17:rc2:*:*:*:*:*:*","matchCriteriaId":"E6E34B23-78B4-4516-9BD8-61B33F4AC49A"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:5.17:rc3:*:*:*:*:*:*","matchCriteriaId":"C030FA3D-03F4-4FB9-9DBF-D08E5CAC51AA"}]}]}],"references":[{"url":"https://git.kernel.org/stable/c/202071d2518537866d291aa7cf26af54e674f4d4","source":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":["Patch"]},{"url":"https://git.kernel.org/stable/c/b7f54894aa7517d2b6c797a499b9f491e9db9083","source":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":["Patch"]},{"url":"https://git.kernel.org/stable/c/c72ea20503610a4a7ba26c769357d31602769c01","source":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":["Patch"]},{"url":"https://git.kernel.org/stable/c/202071d2518537866d291aa7cf26af54e674f4d4","source":"af854a3a-2127-422b-91ae-364da2661108","tags":["Patch"]},{"url":"https://git.kernel.org/stable/c/b7f54894aa7517d2b6c797a499b9f491e9db9083","source":"af854a3a-2127-422b-91ae-364da2661108","tags":["Patch"]},{"url":"https://git.kernel.org/stable/c/c72ea20503610a4a7ba26c769357d31602769c01","source":"af854a3a-2127-422b-91ae-364da2661108","tags":["Patch"]}]}