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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e79357ea8fde45b281be9a8196b806f8@AcuMS.aculab.com>
Date:   Thu, 16 May 2019 09:20:36 +0000
From:   David Laight <David.Laight@...LAB.COM>
To:     'Herbert Xu' <herbert@...dor.apana.org.au>,
        Jakub Kicinski <jakub.kicinski@...ronome.com>,
        "davem@...emloft.net" <davem@...emloft.net>,
        "tgraf@...g.ch" <tgraf@...g.ch>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "oss-drivers@...ronome.com" <oss-drivers@...ronome.com>,
        "neilb@...e.com" <neilb@...e.com>,
        Simon Horman <simon.horman@...ronome.com>
Subject: RE: [PATCH 2/2] rhashtable: Fix cmpxchg RCU warnings

From: Herbert Xu
> Sent: 16 May 2019 08:20
> As cmpxchg is a non-RCU mechanism it will cause sparse warnings
> when we use it for RCU.  This patch adds explicit casts to silence
> those warnings.  This should probably be moved to RCU itself in
> future.
> 
...
> -	if (cmpxchg(prev, NULL, ntbl) == NULL)
> +	if (cmpxchg((union nested_table **)prev, NULL, ntbl) == NULL)

I presume these casts remove an 'rcu' marker on the variable.
Is there a way of marking such casts as 'for sparse only' so
that the compiler does proper type checking.
(Clearly this isn't that relevant here as the cast could be (void **).)

Hmmm something should be checking that the type of the argument
to cmpxchg is 'pointer to "something the size of a pointer"'
Adding any kind of cast subverts that test.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ