ring buffer: Propagate __rb_map_vma return value to caller
Subsystems (2)
PATCH v2 1/1 ring buffer: Propagate __rb_map_vma return value to caller
The return value from __rb_map_vma(), which rejects writable or executable mappings (VM_WRITE, VM_EXEC, or !VM_MAYSHARE), was being ignored. As a result the caller of __rb_map_vma always returned 0 even when the mapping had actually failed, allowing it to proceed with an invalid VMA.
Changes in v2:
* applied minor cleanup suggested by Steve in v1
--- kernel/trace/ring_buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/trace/ring_buffer.c +1 -1
@@ -7273,7 +7273,7 @@ int ring_buffer_map(struct trace_buffer *buffer, int cpu,atomic_dec (&cpu_buffer->resize_disabled); } -return 0 ; +return err; }int ring_buffer_unmap (struct trace_buffer *buffer,int cpu)
Signature · 1 line
2.51.0
Steven Rostedt
maintainerQuoted 10 lines · On Wed, 8 Oct 2025 22:55:16 +0530 Ankit Khushwaha…
The return value from
__rb_map_vma(), which rejects writable or executable mappings (VM_WRITE,VM_EXEC, or !VM_MAYSHARE), was being ignored. As a result the caller of__rb_map_vmaalways returned 0 even when the mapping had actually failed, allowing it to proceed with an invalid VMA.Reported-by [email protected]Signed-off-by Ankit Khushwaha <[email protected]>
Thanks for the update.
Quoted 2 lines
Changes in v2:
* applied minor cleanup suggested by Steve in v1
Note, the "changes" should be below the "---" as that prevents it from being added to the git change log. And it's always good to include a link to the previous version.
For example:
Quoted 2 lines
---
Changes in v2: https://lore.kernel.org/linux-trace-kernel/[email protected]/
* applied minor cleanup suggested by Steve in v1
-- Steve
Quoted 16 lines
kernel/trace/ring_buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)kernel/trace/ring_buffer.c +1
-1@@ -7273,7 +7273,7 @@ int ring_buffer_map(struct trace_buffer *buffer, int cpu,atomic_dec (&cpu_buffer->resize_disabled); } -return 0 ; +return err; }int ring_buffer_unmap (struct trace_buffer *buffer,int cpu)