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]
Date:	Wed, 24 Apr 2013 10:31:40 +0300
From:	Pekka Enberg <penberg@...nel.org>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	Steven Rostedt <rostedt@...dmis.org>,
	David Rientjes <rientjes@...gle.com>,
	LKML <linux-kernel@...r.kernel.org>,
	"linux-mm@...ck.org" <linux-mm@...ck.org>,
	Christoph Lameter <cl@...ux.com>,
	Behan Webster <behanw@...verseincode.com>
Subject: Re: [PATCH] slab: Remove unnecessary __builtin_constant_p()

Hello,

On Tue, Apr 23, 2013 at 12:16 AM, Andrew Morton
<akpm@...ux-foundation.org> wrote:
> The patch made index_of() weaker!
>
> It's probably all a bit academic, given that linux-next does
>
> -/*
> - * This function must be completely optimized away if a constant is passed to
> - * it.  Mostly the same as what is in linux/slab.h except it returns an index.
> - */
> -static __always_inline int index_of(const size_t size)
> -{
> -       extern void __bad_size(void);
> -
> -       if (__builtin_constant_p(size)) {
> -               int i = 0;
> -
> -#define CACHE(x) \
> -       if (size <=x) \
> -               return i; \
> -       else \
> -               i++;
> -#include <linux/kmalloc_sizes.h>
> -#undef CACHE
> -               __bad_size();
> -       } else
> -               __bad_size();
> -       return 0;
> -}
> -

Yup, Christoph nuked it in the following commit:

https://git.kernel.org/cgit/linux/kernel/git/penberg/linux.git/commit/?h=slab/next&id=2c59dd6544212faa5ce761920d2251f4152f408d

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