android_kernel_oneplus_msm8998/arch/arm64
Nathan Chancellor bc76b595cd arm64: futex: Restore oldval initialization to work around buggy compilers
commit ff8acf929014b7f87315588e0daf8597c8aa9d1c upstream.

Commit 045afc24124d ("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: 045afc24124d ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-27 09:34:01 +02:00
..
boot arm64: dts: stratix10: Correct System Manager register size 2018-11-21 09:27:37 +01:00
configs arm64 fixes and clean-ups: 2015-11-12 15:33:11 -08:00
crypto crypto: arm64/aes-ccm - fix logical bug in AAD MAC handling 2019-03-23 08:44:34 +01:00
include arm64: futex: Restore oldval initialization to work around buggy compilers 2019-04-27 09:34:01 +02:00
kernel arm64: debug: Ensure debug handlers check triggering exception level 2019-04-27 09:33:47 +02:00
kvm arm64/kvm: consistently handle host HCR_EL2 flags 2019-01-26 09:42:49 +01:00
lib arm64: add KASAN support 2015-10-12 17:46:36 +01:00
mm arm64: debug: Don't propagate UNKNOWN FAR into si_code for debug signals 2019-04-27 09:33:47 +02:00
net bpf, arm64: fix jit branch offset related to ldimm64 2017-05-14 13:32:58 +02:00
xen
Kconfig arm64: support keyctl() system call in 32-bit mode 2019-04-03 06:23:29 +02:00
Kconfig.debug arm64: remove redundant FRAME_POINTER kconfig option and force to select it 2015-11-10 10:36:00 +00:00
Kconfig.platforms ARM: tegra: select USB_ULPI from EHCI rather than platform 2018-02-25 11:03:51 +01:00
Makefile arm64: remove no-op -p linker flag 2018-12-01 09:46:36 +01:00