lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20201029152404.3534-1-hqjagain@gmail.com>
Date:   Thu, 29 Oct 2020 23:24:04 +0800
From:   Qiujun Huang <hqjagain@...il.com>
To:     rostedt@...dmis.org, mingo@...hat.com, linux-kernel@...r.kernel.org
Cc:     Qiujun Huang <hqjagain@...il.com>
Subject: [PATCH] tracing: Fix in out of bounds write in get_trace_buf

The boundary condition should be 3 as we access
buffer[buffer->nesting][0].

Fixes: e2ace001176dc ("tracing: Choose static tp_printk buffer by explicit nesting count")
Signed-off-by: Qiujun Huang <hqjagain@...il.com>
---
 kernel/trace/trace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 528971714fc6..196a4b7de48a 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -3125,7 +3125,7 @@ static char *get_trace_buf(void)
 {
 	struct trace_buffer_struct *buffer = this_cpu_ptr(trace_percpu_buffer);
 
-	if (!buffer || buffer->nesting >= 4)
+	if (!buffer || buffer->nesting >= 3)
 		return NULL;
 
 	buffer->nesting++;
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ