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:	Thu, 26 Mar 2015 11:11:55 +0100
From:	Christian Borntraeger <borntraeger@...ibm.com>
To:	Stephen Rothwell <sfr@...b.auug.org.au>,
	Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...e.hu>, "H. Peter Anvin" <hpa@...or.com>,
	Peter Zijlstra <peterz@...radead.org>
CC:	linux-next@...r.kernel.org, linux-kernel@...r.kernel.org,
	Davidlohr Bueso <dave@...olabs.net>
Subject: Re: linux-next: build warnings after merge of the access_once tree

Am 26.03.2015 um 09:31 schrieb Stephen Rothwell:
> Hi Christian,
> 
> After merging the access_once tree, today's linux-next build (arm
> multi_v7_defconfig) produced lots of this warning:
> 
> In file included from include/linux/linkage.h:4:0,
>                  from include/linux/preempt.h:9,
>                  from include/linux/spinlock.h:50,
>                  from include/linux/lockref.h:17,
>                  from lib/lockref.c:2:
> In function '__read_once_size',
>     inlined from 'lockref_get' at lib/lockref.c:50:2:
> include/linux/compiler.h:216:3: warning: call to 'data_access_exceeds_word_size' declared with attribute warning: data access exceeds word size and won't be atomic
>    data_access_exceeds_word_size();
>    ^
> 
> Introduced by commit 6becd6bd5e89 ("compiler.h: Fix word size check for
> READ/WRITE_ONCE") presumably interacting with commit 4d3199e4ca8e
> ("locking: Remove ACCESS_ONCE() usage") from the tip tree.
> 

The point of my patch was to actually re-enable the formerly broken check.
And indeed on arm 32 bit 
we read a 64bit variable (lock_count). There is no possible way of doing that
in an atomic fashion with READ_ONCE, so the warning is probably correct

code in lib/lockref.c

#define CMPXCHG_LOOP(CODE, SUCCESS) do {                                        \
        struct lockref old;                                                     \
        BUILD_BUG_ON(sizeof(old) != 8);                                         \
        old.lock_count = READ_ONCE(lockref->lock_count);                        \
        while (likely(arch_spin_value_unlocked(old.lock.rlock.raw_lock))) {     \
                struct lockref new = old, prev = old;                           \
                CODE                                                            \
                old.lock_count = cmpxchg64_relaxed(&lockref->lock_count,        \
                                                   old.lock_count,              \
                                                   new.lock_count);             \
                if (likely(old.lock_count == prev.lock_count)) {                \
                        SUCCESS;                                                \
                }                                                               \
                cpu_relax_lowlatency();                                         \
        }                                                                       \
} while (0)

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