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]
Date:	Thu, 18 Mar 2010 18:30:34 +0900
From:	Tejun Heo <tj@...nel.org>
To:	Frederic Weisbecker <fweisbec@...il.com>
CC:	Sparc <sparclinux@...r.kernel.org>,
	David Miller <davem@...emloft.net>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [BUG] percpu misaligned allocation

Hello,

On 03/18/2010 01:49 PM, Frederic Weisbecker wrote:
> Hi,
> 
> While using the lock events through perf in a sparc box, I can see
> the following message repeated many times:
> 
> 	Kernel unaligned access at TPC[49357c] perf_trace_lock_acquire+0xb4/0x180
> 
> It actually hangs the box as the messages are sent to a serial console.
> 
> When used with perf, the trace events use a per cpu buffer allocated
> in kernel/trace/trace_event_perf.c, and the allocation appears to return
> a misaligned percpu pointer. It is aligned to 4 while it seems it
> requires to be aligned to 8.

Does this fix the problem?

diff --git a/kernel/trace/trace_event_profile.c b/kernel/trace/trace_event_profile.c
index c1cc3ab..d3f7d1b 100644
--- a/kernel/trace/trace_event_profile.c
+++ b/kernel/trace/trace_event_profile.c
@@ -27,13 +27,15 @@ static int ftrace_profile_enable_event(struct ftrace_event_call *event)
 		return 0;
 
 	if (!total_profile_count) {
-		buf = (char *)alloc_percpu(perf_trace_t);
+		buf = (char *)__alloc_percpu(sizeof(perf_trace_t),
+					     __alignof__(unsigned long));
 		if (!buf)
 			goto fail_buf;
 
 		rcu_assign_pointer(perf_trace_buf, buf);
 
-		buf = (char *)alloc_percpu(perf_trace_t);
+		buf = (char *)__alloc_percpu(sizeof(perf_trace_t),
+					     __alignof__(unsigned long));
 		if (!buf)
 			goto fail_buf_nmi;
 


-- 
tejun
--
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