tracing, kasan: Silence Kasan warning in check_stack of stack_tracer
[deliverable/linux.git] / kernel / trace / trace_stack.c
index 202df6cffccaab333c02facc56b28082b09e5e42..2a1abbaca10ec96126f3d8e380244214f77ee2a8 100644 (file)
@@ -156,7 +156,11 @@ check_stack(unsigned long ip, unsigned long *stack)
                for (; p < top && i < stack_trace_max.nr_entries; p++) {
                        if (stack_dump_trace[i] == ULONG_MAX)
                                break;
-                       if (*p == stack_dump_trace[i]) {
+                       /*
+                        * The READ_ONCE_NOCHECK is used to let KASAN know that
+                        * this is not a stack-out-of-bounds error.
+                        */
+                       if ((READ_ONCE_NOCHECK(*p)) == stack_dump_trace[i]) {
                                stack_dump_trace[x] = stack_dump_trace[i++];
                                this_size = stack_trace_index[x++] =
                                        (top - p) * sizeof(unsigned long);
This page took 0.02385 seconds and 5 git commands to generate.