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: <49DDE1B5.4070407@kernel.org>
Date:	Thu, 09 Apr 2009 04:53:25 -0700
From:	Tejun Heo <tj@...nel.org>
To:	Ivan Kokshaysky <ink@...assic.park.msu.ru>
CC:	Martin Schwidefsky <schwidefsky@...ibm.com>,
	Ingo Molnar <mingo@...e.hu>, rusty@...tcorp.com.au,
	tglx@...utronix.de, x86@...nel.org, linux-kernel@...r.kernel.org,
	hpa@...or.com, Paul Mundt <lethal@...ux-sh.org>,
	rmk@....linux.org.uk, starvik@...s.com, ralf@...ux-mips.org,
	davem@...emloft.net, cooloney@...nel.org, kyle@...artin.ca,
	matthew@....cx, grundler@...isc-linux.org, takata@...ux-m32r.org,
	benh@...nel.crashing.org, rth@...ddle.net,
	heiko.carstens@...ibm.com
Subject: Re: [GIT RFC] percpu: use dynamic percpu allocator as the default
 percpu allocator

Hello, Ivan.

Ivan Kokshaysky wrote:
>> it seems like if two different files happen to use static percpu
>> variables with the same name, they would end up sharing it, right?
>> That looks a tad bit dangerous.
> 
> True. One of possible solutions is to add another dummy variable,
> like this:
> 
> #define DEFINE_PER_CPU_SECTION(type, name, section)			\
> 	__attribute__((__section__(".discard"), __unused__))		\
> 		char __dummy__##name;					\
> +	__attribute__((__section__(".discard")))			\
> +		char __per_cpu_multiple_def__##name;			\
> 	__attribute__((__section__(PER_CPU_BASE_SECTION section)))	\
> 		__weak __typeof__(type) per_cpu__##name
> 
> so in that situation we'll get a link failure.

Hmmm... yeah, I agree not allowing common static names is the lesser
poison here.  It's generally a good idea to use uniquely
distinguisible identifier for static symbols anyway to help debugging.
If this limitation is acceptable, I think we should also add the dup
build failure thing to the generic definition too tho so that such
cases can be discovered before they hit alpha and s390 later.

Any objections?

Thanks.

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