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: <alpine.LFD.2.00.1011081724460.2900@localhost6.localdomain6>
Date:	Mon, 8 Nov 2010 17:42:01 +0100 (CET)
From:	Thomas Gleixner <tglx@...utronix.de>
To:	Darren Hart <dvhart@...ux.intel.com>
cc:	linux-kernel@...r.kernel.org,
	Matt Fleming <matt@...sole-pimps.org>, peterz@...radead.org,
	mingo@...e.hu, eric.dumazet@...il.com, jkacur@...hat.com,
	Darren Hart <dvhltc@...ibm.com>
Subject: Re: [PATCH 3/3] futex: add futex_q static initializer

On Wed, 27 Oct 2010, Darren Hart wrote:

> The futex_q struct has grown considerably over the last couple years. I
> believe it now merits a static initializer to avoid uninitialized data
> errors (having spent more time than I care to admit debugging an uninitialized
> q.bitset in an experimental new op code).
> 
> With the key initializer built in, several of the FUTEX_KEY_INIT calls can
> be removed.
> 
> Signed-off-by: Darren Hart <dvhltc@...ibm.com>
> Cc: Thomas Gleixner <tglx@...utronix.de>
> Cc: Peter Zijlstra <peterz@...radead.org>
> Cc: Ingo Molnar <mingo@...e.hu>
> CC: Eric Dumazet <eric.dumazet@...il.com>
> CC: John Kacur <jkacur@...hat.com>
> ---
>  kernel/futex.c |   25 ++++++++++---------------
>  1 files changed, 10 insertions(+), 15 deletions(-)
> 
> diff --git a/kernel/futex.c b/kernel/futex.c
> index 8502498..4a10d44 100644
> --- a/kernel/futex.c
> +++ b/kernel/futex.c
> @@ -131,6 +131,12 @@ struct futex_q {
>  	u32 bitset;
>  };
>  
> +#define FUTEX_Q_INIT \
> +	{ /* list gets initialized in queue_me()*/ \
> +	  .task = NULL, NULL, FUTEX_KEY_INIT \
> +	, NULL, NULL, NULL, FUTEX_BITSET_MATCH_ANY }
> +

That should be a static readonly variable with a proper C99
initializer. 

Thanks,

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