Commit 7d660c9
committed
tracing: Have tracing_max_latency inc the trace array ref count
The tracing_max_latency file points to the trace_array max_latency field.
For an instance, if the file is opened and the instance is deleted,
reading or writing to the file will cause a use after free.
Up the ref count of the trace_array when tracing_max_latency is opened.
Link: https://lkml.kernel.org/r/20230907024803.666889383@goodmis.org
Link: https://lore.kernel.org/all/1cb3aee2-19af-c472-e265-05176fe9bd84@huawei.com/
Cc: stable@vger.kernel.org
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Zheng Yejian <zhengyejian1@huawei.com>
Fixes: 8530dec ("tracing: Add tracing_check_open_get_tr()")
Tested-by: Linux Kernel Functional Testing <lkft@linaro.org>
Tested-by: Naresh Kamboju <naresh.kamboju@linaro.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>1 parent f5ca233 commit 7d660c9
1 file changed
+10
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1772 | 1772 | | |
1773 | 1773 | | |
1774 | 1774 | | |
1775 | | - | |
| 1775 | + | |
1776 | 1776 | | |
1777 | 1777 | | |
1778 | 1778 | | |
| |||
1805 | 1805 | | |
1806 | 1806 | | |
1807 | 1807 | | |
1808 | | - | |
| 1808 | + | |
1809 | 1809 | | |
1810 | 1810 | | |
1811 | 1811 | | |
| |||
6717 | 6717 | | |
6718 | 6718 | | |
6719 | 6719 | | |
6720 | | - | |
| 6720 | + | |
| 6721 | + | |
| 6722 | + | |
6721 | 6723 | | |
6722 | 6724 | | |
6723 | 6725 | | |
6724 | 6726 | | |
6725 | 6727 | | |
6726 | 6728 | | |
6727 | | - | |
| 6729 | + | |
| 6730 | + | |
| 6731 | + | |
6728 | 6732 | | |
6729 | 6733 | | |
6730 | 6734 | | |
| |||
7778 | 7782 | | |
7779 | 7783 | | |
7780 | 7784 | | |
7781 | | - | |
| 7785 | + | |
7782 | 7786 | | |
7783 | 7787 | | |
7784 | 7788 | | |
| 7789 | + | |
7785 | 7790 | | |
7786 | 7791 | | |
7787 | 7792 | | |
| |||
0 commit comments