{"id":"CVE-2026-89747","state":"PUBLISHED","title":"tracing: Fix use-after-free in trace_pipe read on sub-buffer order change","description":"In the Linux kernel, the following vulnerability has been resolved:\n\ntracing: Fix use-after-free in trace_pipe read on sub-buffer order change\n\nWriting to buffer_subbuf_size_kb calls ring_buffer_subbuf_order_set(),\nwhich frees every sub-buffer of the ring buffer, including the reader\npage, and replaces them with newly allocated ones.\n\nReaders of trace_pipe hold pointers into those pages. ring_buffer_peek()\nlooks up an event under cpu_buffer->reader_lock but returns the event\npointer after dropping the lock, and peek_next_entry() then calls\nring_buffer_event_length() and ring_buffer_event_data() on it. If the\nsub-buffer order is changed in that window, the reader dereferences\nfreed memory:\n\n  BUG: KASAN: use-after-free in ring_buffer_peek+0x3e0/0x430\n  Read of size 1 at addr ffff88802a4cf010 by task syz-executor989/6002\n\n  Freed by:\n   free_buffer_page kernel/trace/ring_buffer.c:398 [inline]\n   ring_buffer_subbuf_order_set+0x1325/0x18e0 kernel/trace/ring_buffer.c:7444\n   buffer_subbuf_size_write+0x182/0x280 kernel/trace/trace.c:8221\n\nTake trace_access_lock(RING_BUFFER_ALL_CPUS) around the order change.\nThis is the lock trace_pipe readers already hold across their entire\npeek-and-print loop, so the swap can no longer race with a reader that\nis dereferencing a peeked event.","publishedAt":"2026-09-11T19:46:52.268Z","updatedAt":"2026-10-19T08:52:01.177Z","severity":{"score":7.8,"label":"High","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","source":"Linux"},"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"f9b94daa542a8d2532f0930f01cd9aec2d19621b","status":"affected","lessThan":"05ebe1e1d7d38c2612bacfefe043a33572ae34cb","versionType":"git"},{"version":"f9b94daa542a8d2532f0930f01cd9aec2d19621b","status":"affected","lessThan":"ddbe921ed16a0ad2d9e09574c3f3aabec7528325","versionType":"git"},{"version":"f9b94daa542a8d2532f0930f01cd9aec2d19621b","status":"affected","lessThan":"7a49d19ff9baaf61217e5ec14199c18bc2d93ee4","versionType":"git"},{"version":"f9b94daa542a8d2532f0930f01cd9aec2d19621b","status":"affected","lessThan":"372f8534244d632ad5118e8a87a11291b01712d3","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["kernel/trace/trace.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.8","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.8","versionType":"semver"},{"version":"6.12.109","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.50","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.2.4","status":"unaffected","lessThanOrEqual":"7.2.*","versionType":"semver"},{"version":"7.3","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["kernel/trace/trace.c"]}],"references":["https://git.kernel.org/stable/c/05ebe1e1d7d38c2612bacfefe043a33572ae34cb","https://git.kernel.org/stable/c/ddbe921ed16a0ad2d9e09574c3f3aabec7528325","https://git.kernel.org/stable/c/7a49d19ff9baaf61217e5ec14199c18bc2d93ee4","https://git.kernel.org/stable/c/372f8534244d632ad5118e8a87a11291b01712d3"],"weaknesses":[],"ingestedAt":"2026-10-29T20:13:26.108Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/89xxx/CVE-2026-89747.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-89747","state":"PUBLISHED","datePublished":"2026-09-11T19:46:52.268Z","dateUpdated":"2026-10-19T08:52:01.177Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-09-11T19:38:34.762Z"},"containers":{"cna":{"title":"tracing: Fix use-after-free in trace_pipe read on sub-buffer order change","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\ntracing: Fix use-after-free in trace_pipe read on sub-buffer order change\n\nWriting to buffer_subbuf_size_kb calls ring_buffer_subbuf_order_set(),\nwhich frees every sub-buffer of the ring buffer, including the reader\npage, and replaces them with newly allocated ones.\n\nReaders of trace_pipe hold pointers into those pages. ring_buffer_peek()\nlooks up an event under cpu_buffer->reader_lock but returns the event\npointer after dropping the lock, and peek_next_entry() then calls\nring_buffer_event_length() and ring_buffer_event_data() on it. If the\nsub-buffer order is changed in that window, the reader dereferences\nfreed memory:\n\n  BUG: KASAN: use-after-free in ring_buffer_peek+0x3e0/0x430\n  Read of size 1 at addr ffff88802a4cf010 by task syz-executor989/6002\n\n  Freed by:\n   free_buffer_page kernel/trace/ring_buffer.c:398 [inline]\n   ring_buffer_subbuf_order_set+0x1325/0x18e0 kernel/trace/ring_buffer.c:7444\n   buffer_subbuf_size_write+0x182/0x280 kernel/trace/trace.c:8221\n\nTake trace_access_lock(RING_BUFFER_ALL_CPUS) around the order change.\nThis is the lock trace_pipe readers already hold across their entire\npeek-and-print loop, so the swap can no longer race with a reader that\nis dereferencing a peeked event."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"f9b94daa542a8d2532f0930f01cd9aec2d19621b","status":"affected","lessThan":"05ebe1e1d7d38c2612bacfefe043a33572ae34cb","versionType":"git"},{"version":"f9b94daa542a8d2532f0930f01cd9aec2d19621b","status":"affected","lessThan":"ddbe921ed16a0ad2d9e09574c3f3aabec7528325","versionType":"git"},{"version":"f9b94daa542a8d2532f0930f01cd9aec2d19621b","status":"affected","lessThan":"7a49d19ff9baaf61217e5ec14199c18bc2d93ee4","versionType":"git"},{"version":"f9b94daa542a8d2532f0930f01cd9aec2d19621b","status":"affected","lessThan":"372f8534244d632ad5118e8a87a11291b01712d3","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["kernel/trace/trace.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.8","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.8","versionType":"semver"},{"version":"6.12.109","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.50","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.2.4","status":"unaffected","lessThanOrEqual":"7.2.*","versionType":"semver"},{"version":"7.3","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["kernel/trace/trace.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/05ebe1e1d7d38c2612bacfefe043a33572ae34cb"},{"url":"https://git.kernel.org/stable/c/ddbe921ed16a0ad2d9e09574c3f3aabec7528325"},{"url":"https://git.kernel.org/stable/c/7a49d19ff9baaf61217e5ec14199c18bc2d93ee4"},{"url":"https://git.kernel.org/stable/c/372f8534244d632ad5118e8a87a11291b01712d3"}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","baseScore":7.8,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"AV:L - The UAF is reached only via local tracefs: write() to buffer_subbuf_size_kb (buffer_subbuf_size_write -> ring_buffer_subbuf_order_set) racing with read()/splice() of trace_pipe (tracing_read_pipe -> ring_buffer_peek). No network, adjacent-radio, or physical-device path reaches this code.\nAC:L - The attacker controls both sides of the race: one thread reads trace_pipe while another writes buffer_subbuf_size_kb, which frees the reader page after dropping reader_lock. ring_buffer_peek then dereferences the stale event pointer; the attempt is retryable at will and CONFIG_TRACING is standard.\nPR:L - tracing_check_open_get_tr() checks only LOCKDOWN_TRACEFS and DAC, with no capable() gate. buffer_subbuf_size_kb (0640) and trace_pipe (0440) are delegated via uid=/gid= mounts to tracing-group accounts on Android/Perfetto, ChromeOS, and developer systems, matching CVE-2025-38101 and CVE-2026-74634.\nUI:N - The attacker opens and reads their own trace_pipe and writes buffer_subbuf_size_kb from their own threads. No victim action, mount, or file open by another user is required.\nS:U - The use-after-free corrupts kernel ring-buffer pages and metadata inside the host kernel's security authority. It can yield local privilege escalation but does not cross a VM, IOMMU, container, or hardware trust boundary.\nC:H - ring_buffer_subbuf_order_set() frees reader-page sub-buffers while ring_buffer_peek() still holds a pointer into them; peek_next_entry() and print_trace_line() then read the freed event and copy it to userspace via trace_pipe, disclosing recycled kernel heap contents.\nI:H - Freed sub-buffer pages and buffer_page objects can be reallocated while the reader still consumes attacker-controlled type_len/payload and print_trace_line() dispatches on iter->ent->type. This UAF heap corruption is exploitable for arbitrary kernel writes and control-flow hijack.\nA:H - Dereferencing the freed reader page in ring_buffer_peek()/ring_buffer_event_length() causes a kernel oops, which is the syzbot KASAN use-after-free. The attacker can retrigger that crash at will."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-10-19T08:52:01.177Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.8","versionEndExcluding":"6.12.109"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.8","versionEndExcluding":"6.18.50"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.8","versionEndExcluding":"7.2.4"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.8","versionEndExcluding":"7.3"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}