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:	Fri, 9 Jul 2010 22:53:19 +0200
From:	Sam Ravnborg <sam@...nborg.org>
To:	Steven Rostedt <rostedt@...dmis.org>
Cc:	LKML <linux-kernel@...r.kernel.org>, Ingo Molnar <mingo@...e.hu>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Zeev Tarantov <zeev.tarantov@...il.com>,
	"Rafael J. Wysocki" <rjw@...k.pl>,
	Maciej@...ispam.struernethosting.dk
Subject: Re: [PATCH][GIT PULL][for 2.6.35] tracing: Add alignment to
	syscall metadata declarations

On Fri, Jul 09, 2010 at 04:46:14PM -0400, Steven Rostedt wrote:
> On Fri, 2010-07-09 at 22:33 +0200, Sam Ravnborg wrote:
> > On Fri, Jul 09, 2010 at 03:56:42PM -0400, Steven Rostedt wrote:
> 
> > This looks like a fix that just hide the real bug.
> > If I remember the original report correct the problem is
> > that the symbol:
> > 
> >     __start_syscalls_metadata
> > 
> > Does not point to a valid syscall entry.
> > 
> > The symbol is assigned in vmlinux.lds.h like this:
> > #define TRACE_SYSCALLS() VMLINUX_SYMBOL(__start_syscalls_metadata) = .; \
> >                          *(__syscalls_metadata)                         \
> >                          VMLINUX_SYMBOL(__stop_syscalls_metadata) = .;
> > 
> > Now consider what is happening if we have the following scanario:
> > 
> > . equals 0x1004 so __start_syscalls_metadata is set to 0x1004
> > But __syscall_metadata require 8 byte alignment so it starts at 0x1008.
> 
> 
> I did not know that the linker could start a section at a half a word
> size. That seems to me to be a linker bug.

In this case the linker does not start a section - we are in the
middle of an output section.

   *(__syscalls_metadata)

Is only used to tell the linker that it shall include the content
of the "__syscalls_metadata" input section in the current output section.

So what we have here is something like this:

.data : AT(ADDR(.data) - LOAD_OFFSET) {
	*(_ftrace_events)
	__start_syscalls_metadata = .;
	*(__syscalls_metadata)
}

.data is the outpud section - and the linker will align the output section
to the biggest alignmnet it see within the referenced input sections.

But in this case we have no control of the value of "." (current address)
when we have processed (_ftrace_events) so it may even be at a 2 byte boundary.
The linker will add padding as needed to satisfy the alignmnet of
__syscalls_metadata - but that padding will be inbetween "." and the first
member in __syscalls_metadata.

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