OpenCloudOS-Kernel/arch/arm64
Nathan Chancellor ff8acf9290 arm64: futex: Restore oldval initialization to work around buggy compilers
Commit 045afc2412 ("arm64: futex: Fix FUTEX_WAKE_OP atomic ops with
non-zero result value") removed oldval's zero initialization in
arch_futex_atomic_op_inuser because it is not necessary. Unfortunately,
Android's arm64 GCC 4.9.4 [1] does not agree:

../kernel/futex.c: In function 'do_futex':
../kernel/futex.c:1658:17: warning: 'oldval' may be used uninitialized
in this function [-Wmaybe-uninitialized]
   return oldval == cmparg;
                 ^
In file included from ../kernel/futex.c:73:0:
../arch/arm64/include/asm/futex.h:53:6: note: 'oldval' was declared here
  int oldval, ret, tmp;
      ^

GCC fails to follow that when ret is non-zero, futex_atomic_op_inuser
returns right away, avoiding the uninitialized use that it claims.
Restoring the zero initialization works around this issue.

[1]: https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/

Cc: stable@vger.kernel.org
Fixes: 045afc2412 ("arm64: futex: Fix FUTEX_WAKE_OP atomic ops with non-zero result value")
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2019-04-18 18:17:08 +01:00
..
boot Fixes for dtc warnings, fixes for ethernet transfers on rk3328, 2019-04-07 15:15:31 -07:00
configs Allwinner arm64 defconfig changes for 5.1 2019-02-15 16:51:26 +01:00
crypto Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2019-03-05 09:09:55 -08:00
include arm64: futex: Restore oldval initialization to work around buggy compilers 2019-04-18 18:17:08 +01:00
kernel arm64: backtrace: Don't bother trying to unwind the userspace stack 2019-04-08 18:05:24 +01:00
kvm KVM: arm64: Reset the PMU in preemptible context 2019-03-19 17:56:24 +00:00
lib arm64: string: use asm EXPORT_SYMBOL() 2018-12-10 11:50:12 +00:00
mm treewide: add checks for the return value of memblock_alloc*() 2019-03-12 10:04:02 -07:00
net arm64: bpf: implement jitting of JMP32 2019-01-26 13:33:02 -08:00
xen arm64: mm: Add additional parameter to uaccess_ttbr0_disable 2018-01-17 13:57:49 +01:00
Kconfig arm64: remove obsolete selection of MULTI_IRQ_HANDLER 2019-03-20 17:34:16 +00:00
Kconfig.debug Kconfig: consolidate the "Kernel hacking" menu 2018-08-02 08:06:48 +09:00
Kconfig.platforms This pull request brings in a build fix for arm64 with bcm2835 2019-03-18 10:31:24 -07:00
Makefile kasan, arm64: adjust shadow size for tag-based mode 2018-12-28 12:11:43 -08:00