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: <87h9cdi1b5.fsf@rasmusvillemoes.dk>
Date:	Tue, 28 Jun 2016 21:02:54 +0200
From:	Rasmus Villemoes <linux@...musvillemoes.dk>
To:	Joe Perches <joe@...ches.com>
Cc:	Emese Revfy <re.emese@...il.com>,
	kernel-hardening@...ts.openwall.com,
	Mathias Krause <minipli@...glemail.com>, pageexec@...email.hu,
	spender@...ecurity.net, mmarek@...e.com, keescook@...omium.org,
	linux-kernel@...r.kernel.org, yamada.masahiro@...ionext.com,
	linux-kbuild@...r.kernel.org, minipli@...linux.so,
	linux@...linux.org.uk, catalin.marinas@....com,
	david.brown@...aro.org, benh@...nel.crashing.org,
	tglx@...utronix.de, akpm@...ux-foundation.org,
	jlayton@...chiereds.net, arnd@...db.de
Subject: Re: [PATCH v1 0/2] Introduce the initify gcc plugin

On Tue, Jun 28 2016, Joe Perches <joe@...ches.com> wrote:

>> What happens to string deduplication when one string
>> is in an init function and the same string is also used
>> in a non-init function in the same compilation unit?
>> 
>> foo.c
>> 
>> __init void initfunc(void)
>> {
>> 	pr_info("%s: I'm here\n", __func__);
>> }
>> 
>> void runtimefunc(void)
>> {
>> 	pr_info("I'm here: %s\n", __func__);
>> }
>> 
>> In what section does the string "I'm here: %s\n" get placed
>> or does it get placed into multiple sections?

It'll get placed in multiple sections by the compiler, and nothing bad
happens. String deduplication is something the linker does to sections
equipped with appropriate flags. So in this case that of course means
that the kernel image itself would be slightly bigger, while the used
data after init would be the same. But I don't think there's a lot of
these cases. (Also, "initfunc" would at least vanish).

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ