Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 15911b86 authored by Gaurav Kohli's avatar Gaurav Kohli Committed by Gerrit - the friendly Code Review server
Browse files

trace: Fix race in trace_open and buffer resize call



Below race can come, if trace_open and resize of
cpu buffer is running parallely on different cpus

CPUX                                CPUY
				    ring_buffer_resize
				    atomic_read(&buffer->resize_disabled)
tracing_open
tracing_reset_online_cpus
ring_buffer_reset_cpu

rb_reset_cpu
				    rb_update_pages
				    remove/insert pages

resetting pointer

This race can cause data abort or some times infine loop in rb_remove_pages
and rb_insert_pages while checking pages for sanity.

Take ring buffer lock in rb reset to avoid resetting of cpu buffer.

Change-Id: I1d3344cca99e936d4e04a0e430e0ef9a975404c8
Signed-off-by: default avatarGaurav Kohli <gkohli@codeaurora.org>
parent c55c5408
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment