Message ID | 20201031130931.265995362@goodmis.org |
---|---|
State | Accepted |
Commit | ee11b93f95eabdf8198edd4668bf9102e7248270 |
Headers | show |
Series | [for-linus,1/3] tracing: Fix out of bounds write in get_trace_buf | expand |
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h index f3f5e77123ad..fee535a89560 100644 --- a/kernel/trace/trace.h +++ b/kernel/trace/trace.h @@ -698,7 +698,7 @@ static __always_inline int trace_test_and_set_recursion(int start, int max) current->trace_recursion = val; barrier(); - return bit; + return bit + 1; } static __always_inline void trace_clear_recursion(int bit) @@ -708,6 +708,7 @@ static __always_inline void trace_clear_recursion(int bit) if (!bit) return; + bit--; bit = 1 << bit; val &= ~bit;