uio: Fix stale info pointer in failed registration path
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ a93e7b331568227500186a465fee3c2cb5dffd1f · < 16695e9059d80ea6661e8399064b0c01f641dd8c| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
uio: Fix stale info pointer in failed registration path
After device_add(), the UIO device is visible to userspace and /dev/uioX can be opened. If a later setup step fails, __uio_register_device() unwinds the device but leaves idev->info pointing at the caller-owned struct uio_info.
That is unsafe when an opener races with the failed registration path. The open file keeps a reference to the uio_device, while the caller sees registration failure and may free its struct uio_info. Later file operations can then follow idev->info and dereference freed memory.
Handle post-device_add() failures like unregister: remove UIO attributes while the info pointer is still valid, then clear idev->info under info_lock and wake existing waiters/async users before removing the device and minor. This makes already-open file descriptors observe the same "device gone" state as normal uio_unregister_device().
From the CVE record · Linux
The Linux kernel UIO registration path can leave a pointer to freed memory if setup fails after the device becomes visible. A local user who opens /dev/uioX during that failure can trigger a dereference of freed memory through later file operations; the input does not specify authentication requirements.
Engineers running Linux kernels that use UIO should check their kernel's advisory for affected versions.