zram: fix out-of-bounds access in read_block_state()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ c0265342bff4fcaa2cdf13f4596244c18d4a7ae5 · < e7dbcb7a561a21e9a8f5b5fa90bb95aefbd0739d| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
zram: fix out-of-bounds access in read_block_state()
read_block_state() calculates nr_pages before taking dev_lock. If the device is reset and reinitialized with a smaller disksize before lock acquisition, nr_pages still describes the old table. The subsequent loop can then call slot_lock() past the end of the newly allocated table.
Read disksize after acquiring dev_lock and checking that the device is initialized. The read lock then keeps the table and its bound stable for the duration of the scan.
From the CVE record · Linux
Linux kernel zram's read_block_state() can access beyond an allocated table if a device is reset and reinitialized with a smaller disk size before it acquires the device lock. The input does not specify whether an attacker can trigger this condition or what access it would require.
Engineers running Linux kernels with zram should check their installations; affected versions are not specified.