ring-buffer: Check resize_disabled before publishing the new subbuf order
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
ring-buffer: Check resize_disabled before publishing the new subbuf order
ring_buffer_subbuf_order_set() stores the new order and only then walks the CPUs, returning -EBUSY if any of them has resizing disabled. A user mapped buffer has resizing disabled, and __rb_map_vma() reads buffer->subbuf_order without buffer->mutex, so an mmap of an already mapped CPU racing the failing order change sizes the mapping with the new order and inserts pages past the sub-buffer into the VMA.
Check the CPUs before storing the new order.
From the CVE record · Linux
The Linux kernel ring-buffer can publish a new sub-buffer order before checking whether resizing is disabled. A local mmap of an already mapped CPU that races with a rejected order change can size the mapping incorrectly and insert pages past the sub-buffer into the VMA.
Engineers running the Linux kernel should check whether their version is affected; affected versions were not specified.