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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140508121624.4ca87b2c@gandalf.local.home>
Date:	Thu, 8 May 2014 12:16:24 -0400
From:	Steven Rostedt <rostedt@...dmis.org>
To:	Sasha Levin <sasha.levin@...cle.com>
Cc:	Frederic Weisbecker <fweisbec@...il.com>,
	Ingo Molnar <mingo@...nel.org>,
	LKML <linux-kernel@...r.kernel.org>,
	Dave Jones <davej@...hat.com>
Subject: Re: tracing: NULL ptr deref in ring_buffer_wait

On Thu, 08 May 2014 11:31:41 -0400
Sasha Levin <sasha.levin@...cle.com> wrote:

> On 05/05/2014 11:46 AM, Sasha Levin wrote:
> >>> >> [ 3589.407670] vfs_read (fs/read_write.c:430)
> >>> >> [ 3589.407670] SyS_read (fs/read_write.c:568 fs/read_write.c:560)
> >>> >> [ 3589.407670] tracesys (arch/x86/kernel/entry_64.S:746)
> >>> >> [ 3589.407670] Code: 85 cd 0c 00 00 48 c7 c1 5c e1 6d ac 48 c7 c2 af 89 6d ac 31 c0 be fa 0b 00 00 48 c7 c7 16 e1 6d ac e8 3c 68 f9 ff e9 a7 0c 00 00 <49> 81 7d 00 80 81 76 ae b8 00 00 00 00 44 0f 44 c0 eb 07 0f 1f
> >>> >> [ 3589.407670] RIP __lock_acquire (kernel/locking/lockdep.c:3070 (discriminator 1))
> >>> >> [ 3589.407670]  RSP <ffff88005c9d1c18>
> >>> >> [ 3589.407670] CR2: 00000000000001f0
> >> > 
> >> > Is this easily reproducible?
> > Nope, only saw it once.
> 
> And a second time today, I guess I could put a debug patch and see if that
> helps, if you had something in mind...
> 

All I can think of is to try this:

-- Steve

diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
index c634868..7cacbad 100644
--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
@@ -558,6 +558,10 @@ void ring_buffer_wait(struct ring_buffer *buffer, int cpu)
 		work = &buffer->irq_work;
 	else {
 		cpu_buffer = buffer->buffers[cpu];
+		if (unlikely(!cpu_buffer)) {
+			printk("null cpu buffer, %d\n", cpu);
+			BUG();
+		}
 		work = &cpu_buffer->irq_work;
 	}
 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ