blob: 2dcb5d00de69949fdc18b7cb6a2132fdbc21a0ab [file] [log] [blame]
The vulnerability CVE-2021-47334 is a use-after-free (UAF) bug in the Linux kernel, specifically in the `ibmasm_init_one` function of the `libmasm/module` component. The UAF occurs when the `ibmasm_init_remote_input_dev()` function allocates memory for `mouse_dev` and `keybd_dev` using `input_allocate_device()`, but then frees them using `input_free_device()` in the error handling path.
The problem arises because even after freeing these devices, the code attempts to unregister them again in the `ibmasm_free_remote_input_dev(sp)` function, which leads to a use-after-free condition. This can cause undefined behavior, including potential crashes or exploitation by an attacker.
The fix involves adding an "error_init_remote" label to handle the error of `ibmasm_init_remote_input_dev()`, ensuring that the devices are not freed and then attempted to be unregistered. The vulnerability has been fixed in various Linux kernel versions, including 4.4.276, 4.9.276, 4.14.240, 4.19.198, 5.4.134, 5.10.52, 5.12.19, 5.13.4, and 5.14.