AZL-117971: CVE-2026-143028 affecting package kernel 6.6.161.1-1
In the Linux kernel, the following vulnerability has been resolved:
dm: fix use-after-free when dmgetdevice() widens the open mode
There's an UAF bug in dmgetdevice(): when a table construction calls dmgetdevice() on the same device twice with widen access mode (e.g., read-only first then read-write), the second dmgetdevice() calls upgrademode(), which reopens the device in upgraded mode, making previously returned dmdev a stale pointer.
Fixing approaches: - Add per-mode views (dmdevref) from a per-device dmdevinternal to multiple tabledevices. - Keep reusing the dmdevref when the requested mode is included, i.e., a read-only reference can reuse the read-write opened device within a table. - Maintain a canonical blockdevice pointer in dmdevinternal for handling the DMTABLEDEPS ioctl.
Also tweak the way of mode sharing check in findref() to "(x & mask) == mask". The result stays the same to the previous upgrademode() guard "(x | mask) == x".
Pros: keep the relationship between dmdevinternal and tabledevice: one dmdevinternal per device, regardless the mode, so the output of DMMTABLEDEPS ioctl unchanged.
Cons: extra dmdevref allocation.
Note that now the tabledevice's count not necessarily mean the number tables referecing this <dev, mode> pair, since we're allowing multiple references within a table.
Affected Software
Event History
Frequently Asked Questions
What device-mapper usage pattern is required to trigger the flaw?
A device-mapper table must call dm_get_device() for the same underlying device more than once while widening the open mode, such as requesting read-only access first and read-write access afterward.
What makes the earlier device reference unsafe?
The mode-widening request reopens the device in the upgraded mode. That action makes dm_dev pointers returned by the earlier request stale, creating a use-after-free condition.
Does the issue affect repeated requests that do not widen access?
The described vulnerable path is specifically a repeated request that widens access mode. The fix also allows a read-only reference to reuse an already read-write opened device within the same table.