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:	Tue, 28 Apr 2009 08:15:57 +0200
From:	Nick Piggin <npiggin@...e.de>
To:	Valdis.Kletnieks@...edu
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	linux-kernel@...r.kernel.org, mm-commits@...r.kernel.org
Subject: Re: mmotm 2009-04-24-18-14 uploaded - NVidia indigestion

On Mon, Apr 27, 2009 at 02:45:15PM -0400, Valdis.Kletnieks@...edu wrote:
> On Sat, 25 Apr 2009 07:24:34 +0200, Nick Piggin said:
> 
> > >             #include <linux/version.h>
> > >             #include <linux/utsname.h>
> > >             int main() {
> > >               if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)) {
> > >                 return 0;
> > >               } else {
> > >                 return 1;
> > >               }
> 
> > Yeah BUILD_BUG_ON does work like that. I can't for the life of me
> > understand why it triggered though. Is anything in your external
> > code calling kmalloc_slab directly?
> 
> See above - I didn't think LINUX_VERSION_CODE cared about kmalloc, but
> I could be wrong on this. ;)
> 
> > What's the preprocessor output look like?
> 
> The problem appears to be that if you only include version.h and utsname.h,
> and *don't* actually reference kmalloc_slab, it doesn't know that the size_t
> is actually a constant, so it whinges.  Most modules end up doing at least
> one kmalloc(), so kmalloc() and kmalloc_slab() get inlined, the constant 'size'
> gets propogated, and life is good.  If you *don't* call kmalloc(), bad things
> happen. ;)

Hmm, yes if you build without -O, then it appears like the compiler
trips over this. I wouldn't be unhappy with just removing the BUILD_BUG_ON,
but shouldn't the module be using -O[s2]?

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