Skip to contentSkip to conversation

CVE-2026-99159: ring-buffer: Fix the sub-buffer array base in rb_meta_subbuf_idx()

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Oct 28

lore
Share & tools
lore
#0 lore raw

From: Greg Kroah-Hartman <[email protected]>

Description
===========

In the Linux kernel, the following vulnerability has been resolved:

ring-buffer: Fix the sub-buffer array base in rb_meta_subbuf_idx()

On a persistent ring buffer, rb_meta_subbuf_idx() can return an index one sub-buffer too high. rb_setup_ids_meta_page() then fills subbuf_ids[] shifted by one and leaves subbuf_ids[0] NULL, which __rb_map_vma() dereferences when userspace maps trace_pipe_raw. rb_update_meta_reader() writes two such indices into meta->buffers[], which rb_cpu_meta_valid() would reject on the next boot, discarding the previous boot's trace.

A CPU's sub-buffer array starts after its meta header and the nr_subbufs integers that follow, aligned up to a sub-buffer. rb_meta_subbuf_idx() inverts that calculation but skips only the integers, not the header, so its base is one sub-buffer low whenever the omitted header size crosses the alignment boundary.

Invert the calculation with rb_subbufs_from_meta() rather than repeating it. rb_range_buffer() maps an index back to an address through the same helper, so the two directions can no longer disagree.

The Linux kernel CVE team has assigned CVE-2026-99159 to this issue.

Affected and fixed versions
===========================

	Issue introduced in 6.12 with commit b14d032973d4e6c36e025e96ea3437de53d072d9 and fixed in 6.18.59 with commit 2f1248b728b56d583ea454fedf239550c49f7b18
	Issue introduced in 6.12 with commit b14d032973d4e6c36e025e96ea3437de53d072d9 and fixed in 7.2.13 with commit 7469b3585ef5f65840d467d2caa811a9098c84b9
	Issue introduced in 6.12 with commit b14d032973d4e6c36e025e96ea3437de53d072d9 and fixed in 7.3 with commit 25132363c723afc39aace8b098f547ab4a0ea759

Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.

Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at

	https://cve.org/CVERecord/?id=CVE-2026-99159

will be updated if fixes are backported, please check that for the most up to date information about this issue.

Affected files
==============

The file(s) affected by this issue are:
kernel/trace/ring_buffer.c

Mitigation
==========

The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:

	https://git.kernel.org/stable/c/2f1248b728b56d583ea454fedf239550c49f7b18
	https://git.kernel.org/stable/c/7469b3585ef5f65840d467d2caa811a9098c84b9
	https://git.kernel.org/stable/c/25132363c723afc39aace8b098f547ab4a0ea759