Repository navigation
Commit bbeb974
tracing: 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 infinte loop in
rb_remove_pages and rb_insert_pages while checking pages
for sanity.
Take buffer lock to fix this.
Link: https://lkml.kernel.org/r/1601976833-24377-1-git-send-email-gkohli@codeaurora.org
Cc: stable@vger.kernel.org
Fixes: b23d7a5 ("ring-buffer: speed up buffer resets by avoiding synchronize_rcu for each CPU")
Signed-off-by: Gaurav Kohli <gkohli@codeaurora.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>1 parent 6d9bd13 commit bbeb974
1 file changed
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4866 | 4866 | | |
4867 | 4867 | | |
4868 | 4868 | | |
| 4869 | + | |
| 4870 | + | |
| 4871 | + | |
4869 | 4872 | | |
4870 | 4873 | | |
4871 | 4874 | | |
| |||
4876 | 4879 | | |
4877 | 4880 | | |
4878 | 4881 | | |
| 4882 | + | |
| 4883 | + | |
4879 | 4884 | | |
4880 | 4885 | | |
4881 | 4886 | | |
| |||
4889 | 4894 | | |
4890 | 4895 | | |
4891 | 4896 | | |
| 4897 | + | |
| 4898 | + | |
| 4899 | + | |
4892 | 4900 | | |
4893 | 4901 | | |
4894 | 4902 | | |
| |||
4907 | 4915 | | |
4908 | 4916 | | |
4909 | 4917 | | |
| 4918 | + | |
| 4919 | + | |
4910 | 4920 | | |
4911 | 4921 | | |
4912 | 4922 | | |
| |||
0 commit comments