Linux: tracing: Fix subbuf resize races with trace_pipe_raw readers
What fixes it
- 574efd988d116bd56ac688ab2d64e06ba0da982aLinuxCVE List
- 3f30b2cd4eba45c05f822f03f1b0f4077d6d4dc3LinuxCVE List
- 75b37b8369778b69ce9738d1c97685a1615cb252LinuxCVE List
A fixed version on one release line is not the upgrade target for every line. Check your exact version and any vendor backports.
Description
In the Linux kernel, the following vulnerability has been resolved:
tracing: Fix subbuf resize races with trace_pipe_raw readers
Concurrent subbuffer resizes may crash trace_pipe_raw readers or leak uninitialized memory to userspace due to stale size values.
Modify ring_buffer_alloc_read_page() to handle the resizing of an existing buffer_data_read_page if necessary and add a new ring_buffer_read_page_size(). This new function enables ring-buffer buffer_data_read_page users to not call the racy ring_buffer_subbuf_size_get(). This makes the spare_size member of ftrace_buffer_info redundant.
Finally, handle buffer_data_read_page/reader_page order discrepancy in ring_buffer_read_page(). On a mismatch simply copy manually the data to the buffer_data_read_page.
Text from CVE List
Affected versions 10
- Linuxaffected: bce761d757452ba5eb77e11fecc37a04b67494e7 before 574efd988d116bd56ac688ab2d64e06ba0da982aCVE List
- Linuxaffected: bce761d757452ba5eb77e11fecc37a04b67494e7 before 3f30b2cd4eba45c05f822f03f1b0f4077d6d4dc3CVE List
- Linuxaffected: bce761d757452ba5eb77e11fecc37a04b67494e7 before 75b37b8369778b69ce9738d1c97685a1615cb252CVE List
- Linuxaffected: bce761d757452ba5eb77e11fecc37a04b67494e7 before dae8dda341d2d9034a90d59e8a7d502e1263813fCVE List
- Linuxaffected: 6.8CVE List
- Linuxunaffected: all versions before 6.8CVE List
- Linuxunaffected: 6.12.114 through 6.12.*CVE List
- Linuxunaffected: 6.18.57 through 6.18.*CVE List
- Linuxunaffected: 7.2.7 through 7.2.*CVE List
- Linuxunaffected: 7.3CVE List
References 4
- git.kernel.org/stable/c/574efd988d116bd56ac688ab2d64e06ba0da982aReferencevia CVE List
- git.kernel.org/stable/c/3f30b2cd4eba45c05f822f03f1b0f4077d6d4dc3Referencevia CVE List
- git.kernel.org/stable/c/75b37b8369778b69ce9738d1c97685a1615cb252Referencevia CVE List
- git.kernel.org/stable/c/dae8dda341d2d9034a90d59e8a7d502e1263813fReferencevia CVE List