33 lines
3.0 KiB
JSON
Raw Normal View History

{
"id": "CVE-2022-48801",
"sourceIdentifier": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
"published": "2024-07-16T12:15:04.630",
"lastModified": "2024-07-16T13:43:58.773",
"vulnStatus": "Awaiting Analysis",
"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\u00e9n creado en la zona de usuario, intentamos limpiar colocando de nuevo 'fd' y liberando ' ib'. El c\u00f3digo 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\u00f3digo 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\u00fan utilizable y haciendo que el c\u00f3digo funcione en un puntero 'archivo->datos_privados' colgando. En lugar de dejar el kernel en un estado parcialmente da\u00f1ado, no intente limpiar expl\u00edcitamente y dejar esto en la ruta de salida del proceso que liberar\u00e1 cualquier fds a\u00fan v\u00e1lido, incluido el creado por la llamada anterior a anon_inode_getfd(). Simplemente devuelva -EFAULT para indicar el error."
}
],
"metrics": {},
"references": [
{
"url": "https://git.kernel.org/stable/c/202071d2518537866d291aa7cf26af54e674f4d4",
"source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67"
},
{
"url": "https://git.kernel.org/stable/c/b7f54894aa7517d2b6c797a499b9f491e9db9083",
"source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67"
},
{
"url": "https://git.kernel.org/stable/c/c72ea20503610a4a7ba26c769357d31602769c01",
"source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67"
}
]
}