漏洞标题
修复uio_open中的使用后释放错误。
漏洞描述信息
在Linux内核中,已经修复了以下漏洞:
uio: 修复uio_open中的空闲后释放(use-after-free)问题
core-1 core-2
-------------------------------------------------------
uio_unregister_device uio_open
idev = idr_find()
device_unregister(&idev->dev) 设备注销
put_device(&idev->dev) 放置设备
uio_device_release
get_device(&idev->dev))
kfree(idev) 释放idev
uio_free_minor(minor) 释放次要设备
uio_release
put_device(&idev->dev))
kfree(idev)
-------------------------------------------------------
在core-1的uio_unregister_device()中,当idev->dev kobject引用计数为1时,device_unregister将kfree idev。但在core-1执行完设备注销后,在put_device和kfree之前,core-2可能获取到设备。接着:
1. 在core-1 kfree idev之后,core-2会为idev进行空闲后释放(use-after-free)操作。
2. 当core-2执行uio_release、put_device时,idev将被双重释放。
为了修复这个问题,我们可以在minor_lock下获取idev,并原子地增加idev引用计数。
CVSS信息
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
漏洞类别
释放后使用
漏洞标题
uio: Fix use-after-free in uio_open
漏洞描述信息
In the Linux kernel, the following vulnerability has been resolved:
uio: Fix use-after-free in uio_open
core-1 core-2
-------------------------------------------------------
uio_unregister_device uio_open
idev = idr_find()
device_unregister(&idev->dev)
put_device(&idev->dev)
uio_device_release
get_device(&idev->dev)
kfree(idev)
uio_free_minor(minor)
uio_release
put_device(&idev->dev)
kfree(idev)
-------------------------------------------------------
In the core-1 uio_unregister_device(), the device_unregister will kfree
idev when the idev->dev kobject ref is 1. But after core-1
device_unregister, put_device and before doing kfree, the core-2 may
get_device. Then:
1. After core-1 kfree idev, the core-2 will do use-after-free for idev.
2. When core-2 do uio_release and put_device, the idev will be double
freed.
To address this issue, we can get idev atomic & inc idev reference with
minor_lock.
CVSS信息
N/A
漏洞类别
N/A
漏洞标题
Linux kernel 安全漏洞
漏洞描述信息
Linux kernel是美国Linux基金会的开源操作系统Linux所使用的内核。 Linux kernel 存在安全漏洞,该漏洞源于 uio 模块的 uio_open 中存在释放后重用问题。
CVSS信息
N/A
漏洞类别
其他