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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 12 Dec 2009 01:21:48 +0100
From:	Sam Ravnborg <sam@...nborg.org>
To:	Randy Dunlap <randy.dunlap@...cle.com>
Cc:	Matt Mackall <mpm@...enic.com>,
	Herbert Xu <herbert@...dor.apana.org.au>,
	Rusty Russell <rusty@...tcorp.com.au>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	samr@...nborg.org
Subject: Re: hwrng: virtio - Rename driver object to remove section
	mismatch warning

On Fri, Dec 11, 2009 at 12:08:49PM -0800, Randy Dunlap wrote:
> On Fri, 11 Dec 2009 13:25:57 -0600 Matt Mackall wrote:
> 
> > On Fri, 2009-12-11 at 23:36 +0800, Herbert Xu wrote:
> > > Hi:
> > > 
> > > Finally found the cause of the section mismatch warning in hwrng.
> > > Apparently in addition to __devexit_p we now have to name the
> > > variable in a certain way.
> > 
> > That's fairly appalling. Any idea why?
> 
> (I haven't read the rest of this thread..)
> 
> scripts/mod/modpost.c looks for certain variable names to identify
> variables that can have references to other (non-data) sections.
> It's mostly explained there.

Another option is to annotate the relevant variable.

>From init.h:
/* modpost check for section mismatches during the kernel build.
 * A section mismatch happens when there are references from a
 * code or data section to an init section (both code or data).
 * The init sections are (for most archs) discarded by the kernel
 * when early init has completed so all such references are potential bugs.
 * For exit sections the same issue exists.
 * The following markers are used for the cases where the reference to
 * the *init / *exit section (code or data) is valid and will teach
 * modpost not to issue a warning.
 * The markers follow same syntax rules as __init / __initdata. */
#define __ref            __section(.ref.text) noinline
#define __refdata        __section(.ref.data)
#define __refconst       __section(.ref.rodata)

	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