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: <20200713140624.GA17904@localhost.localdomain>
Date:   Mon, 13 Jul 2020 17:06:24 +0300
From:   Alexey Dobriyan <adobriyan@...il.com>
To:     Peter Zijlstra <peterz@...radead.org>
Cc:     mingo@...hat.com, will@...nel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] rwsem: fix commas in initialisation

On Mon, Jul 13, 2020 at 01:51:41PM +0200, Peter Zijlstra wrote:
> On Sat, Jul 11, 2020 at 05:59:54PM +0300, Alexey Dobriyan wrote:
> > Leading comma prevents arbitrary reordering of initialisation clauses.
> > The whole point of C99 initialisation is to allow any such reordering.
> 
> I'm conflicted on this argument, the only reason I'd be inclined to take
> this patch is that it allows fixing the initialization order to not be
> random.

Yes, this is how the issue was noticed.

> That is, I'd fold in the below.
> 
> --- a/include/linux/rwsem.h
> +++ b/include/linux/rwsem.h
> @@ -89,9 +89,9 @@ static inline int rwsem_is_locked(struct
>  #define __RWSEM_INITIALIZER(name)				\
>  	{ __RWSEM_INIT_COUNT(name),				\
>  	  .owner = ATOMIC_LONG_INIT(0),				\
> -	  .wait_list = LIST_HEAD_INIT((name).wait_list),	\
> -	  .wait_lock = __RAW_SPIN_LOCK_UNLOCKED(name.wait_lock),\
>  	  __RWSEM_OPT_INIT(name)				\
> +	  .wait_lock = __RAW_SPIN_LOCK_UNLOCKED(name.wait_lock),\
> +	  .wait_list = LIST_HEAD_INIT((name).wait_list),	\

One less chunk to compile with g++, a billion to go :^)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ