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: <20090118122610.GA3508@elte.hu>
Date:	Sun, 18 Jan 2009 13:26:10 +0100
From:	Ingo Molnar <mingo@...e.hu>
To:	Jaswinder Singh Rajput <jaswinder@...nel.org>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	Sam Ravnborg <sam@...nborg.org>,
	x86 maintainers <x86@...nel.org>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [GIT PULL -tip] fix 41 'make headers_check' warnings


* Jaswinder Singh Rajput <jaswinder@...nel.org> wrote:

> On Sun, 2009-01-18 at 12:02 +0100, Ingo Molnar wrote:
> > * Jaswinder Singh Rajput <jaswinder@...nel.org> wrote:
> > 
> > > diff --git a/include/linux/acct.h b/include/linux/acct.h
> > > index 882dc72..a20c97c 100644
> > > --- a/include/linux/acct.h
> > > +++ b/include/linux/acct.h
> > > @@ -59,9 +59,13 @@ struct acct
> > >  	comp_t		ac_majflt;		/* Major Pagefaults */
> > >  	comp_t		ac_swaps;		/* Number of Swaps */
> > >  /* m68k had no padding here. */
> > > -#if !defined(CONFIG_M68K) || !defined(__KERNEL__)
> > > +#ifdef __KERNEL__
> > > +#ifndef CONFIG_M68K
> > >  	__u16		ac_ahz;			/* AHZ */
> > > -#endif
> > > +#endif /* CONFIG_M68K */
> > > +#else /* __KERNEL__ */
> > > +	__u16		ac_ahz;			/* AHZ */
> > > +#endif /* __KERNEL__ */
> > 
> > that looks rather ugly.
> > 
> > Why not just flip it around to:
> > 
> > 	#if !defined(__KERNEL__) || !defined(CONFIG_M68K)
> > 
> > ? Does headers_check misinterpret that?
> > 
> 
> This will not many any difference:
> then usr/include/linux/acct.h will look like:
> #if !defined(__KERNEL__) || !defined(CONFIG_M68K)
>         __u16           ac_ahz;                 /* AHZ */
> #endif
> 
> And we will get same warning:
>   usr/include/linux/acct.h:62: leaks CONFIG_M68K to userspace where it is not valid

which would be a false positive. Sam, what would be your preference to 
annotate the code in such cases?

> > i.e. always provide the wider type to user-space.
> 
> Sorry, this will not be helpful we will still get the warning.

the problem here is that the type you export to user-space is the _wrong_ 
(narrow) type. Including types.h is one thing - exporting something to 
user-space is another thing. It might not matter in practice.

Furthermore, the 3 blocks are there as well - while there should only be 
two.

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