Message ID | 20201031130931.062903467@goodmis.org |
---|---|
State | Accepted |
Commit | c1acb4ac1a892cf08d27efcb964ad281728b0545 |
Headers | show |
Series | [for-linus,1/3] tracing: Fix out of bounds write in get_trace_buf | expand |
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 528971714fc6..daa96215e294 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -3132,7 +3132,7 @@ static char *get_trace_buf(void) /* Interrupts must see nesting incremented before we use the buffer */ barrier(); - return &buffer->buffer[buffer->nesting][0]; + return &buffer->buffer[buffer->nesting - 1][0]; } static void put_trace_buf(void)