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] [day] [month] [year] [list]
Message-ID: <BLU0-SMTP1023B0562D792E4BCE035E96C80@phx.gbl>
Date:	Thu, 10 Mar 2011 17:02:05 -0500
From:	Mathieu Desnoyers <mathieu.desnoyers@...ymtl.ca>
To:	Steven Rostedt <rostedt@...dmis.org>
CC:	Jason Baron <jbaron@...hat.com>, peterz@...radead.org,
	hpa@...or.com, mingo@...e.hu, tglx@...utronix.de,
	andi@...stfloor.org, roland@...hat.com, rth@...hat.com,
	masami.hiramatsu.pt@...achi.com, fweisbec@...il.com,
	avi@...hat.com, davem@...emloft.net, sam@...nborg.org,
	ddaney@...iumnetworks.com, michael@...erman.id.au,
	linux-kernel@...r.kernel.org, Ralf Baechle <ralf@...ux-mips.org>
Subject: Re: [PATCH 0/2] jump label: update for .39

* Steven Rostedt (rostedt@...dmis.org) wrote:
> On Thu, 2011-03-10 at 16:14 -0500, Mathieu Desnoyers wrote:
> 
> > > Just insert a long "Reserved" word.
> > 
> > I agree that this solution can work, but it's only because the
> > "object" definition is done in assembly in this case (and not in C, like
> > we did for trace event and tracepoints). Padding to power of 2 multiples
> > should make the linker happy. There should be a nice comment beside
> > these padding elements though.
> 
> Rereading what David and even what you wrote just now, I don't think
> this is even needed. As you said. The issue with us is that we had
> defined structs in C as static which lost all bets. Not to mention,
> these structures were not natural word aligned.
> 
> The linker should not be adding holes more than natural word alignment.
> Why waste space?

Here is what I am concerned about (maybe wongly, we'll see):

if we take a few objects, chosen arbitrarily, which will end up being
linked together, e.g.

in kernel/

Sections:
Idx Name          Size      VMA               LMA               File off  Algn

objdump -h *.o |grep jump
 28 __jump_table  000007e0  0000000000000000  0000000000000000  000ba614  2**0
  5 __jump_table  00000030  0000000000000000  0000000000000000  0000077c  2**0
  6 __jump_table  00000048  0000000000000000  0000000000000000  000027d8  2**0
  9 __jump_table  00000048  0000000000000000  0000000000000000  00002788  2**0
  3 __jump_table  000000c0  0000000000000000  0000000000000000  00000f60  2**0
  3 __jump_table  00000048  0000000000000000  0000000000000000  0000092c  2**0
  6 __jump_table  00000018  0000000000000000  0000000000000000  000008db  2**0
  8 __jump_table  00000018  0000000000000000  0000000000000000  00002744  2**0
  5 __jump_table  00000030  0000000000000000  0000000000000000  000008ea  2**0
  6 __jump_table  00000078  0000000000000000  0000000000000000  000066ad  2**0
  7 __jump_table  00000018  0000000000000000  0000000000000000  000023f0  2**0
 13 __jump_table  00000120  0000000000000000  0000000000000000  00010c9a  2**0
  7 __jump_table  00000060  0000000000000000  0000000000000000  00005126  2**0
  5 __jump_table  00000138  0000000000000000  0000000000000000  000020f4  2**0
  6 __jump_table  00000180  0000000000000000  0000000000000000  000045c6  2**0
 10 __jump_table  00000078  0000000000000000  0000000000000000  00005060  2**0

We see here that the section alignment is 2**0 for each object (that is
for a 2.6.38-rc7-tip kernel). Now as long as the alignment stays like
this, it's OK, because the linker won't add padding between the
sections. So my question is: is there any guarantee that the linker will
keep this alignment to 2**0, or is there a possibility that it bumps it
to an higher value ?

For instance, if we have two objects linked together in a first linking
phase, thus generating a resulting object that uses the 8-byte alignment
specified by the linker script, and then we have a second link phase
that uses this intermediate object and links it into the kernel, this
might add such a whole on a 32-bit architecture, no ? (e.g. see the
e1000e Makefile, it seems to use this 2-steps method when built as =Y).

Thanks,

Mathieu

-- 
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com
--
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