All of lore.kernel.org
 help / color / mirror / Atom feed
* [GIT pull] locking/urgent for 5.7-rc5
@ 2020-05-10 11:55 Thomas Gleixner
  2020-05-10 11:55 ` [GIT pull] objtool/urgent " Thomas Gleixner
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Thomas Gleixner @ 2020-05-10 11:55 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel, x86

Linus,

please pull the latest locking/urgent branch from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git locking-urgent-2020-05-10

up to:  8101b5a1531f: ARM: futex: Address build warning


A single fix for the fallout of the recent futex uacess rework.

With those changes GCC9 fails to analyze arch_futex_atomic_op_inuser()
correctly and emits a 'maybe unitialized' warning. While we usually ignore
compiler stupidity the conditional store is pointless anyway because the
correct case has to store. For the fault case the extra store does no harm.

Thanks,

	tglx

------------------>
Thomas Gleixner (1):
      ARM: futex: Address build warning


 arch/arm/include/asm/futex.h | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/arch/arm/include/asm/futex.h b/arch/arm/include/asm/futex.h
index e133da303a98..a9151884bc85 100644
--- a/arch/arm/include/asm/futex.h
+++ b/arch/arm/include/asm/futex.h
@@ -165,8 +165,13 @@ arch_futex_atomic_op_inuser(int op, int oparg, int *oval, u32 __user *uaddr)
 	preempt_enable();
 #endif
 
-	if (!ret)
-		*oval = oldval;
+	/*
+	 * Store unconditionally. If ret != 0 the extra store is the least
+	 * of the worries but GCC cannot figure out that __futex_atomic_op()
+	 * is either setting ret to -EFAULT or storing the old value in
+	 * oldval which results in a uninitialized warning at the call site.
+	 */
+	*oval = oldval;
 
 	return ret;
 }


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-05-10 19:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-10 11:55 [GIT pull] locking/urgent for 5.7-rc5 Thomas Gleixner
2020-05-10 11:55 ` [GIT pull] objtool/urgent " Thomas Gleixner
2020-05-10 19:45   ` pr-tracker-bot
2020-05-10 11:55 ` [GIT pull] x86/urgent " Thomas Gleixner
2020-05-10 19:45   ` pr-tracker-bot
2020-05-10 19:45 ` [GIT pull] locking/urgent " pr-tracker-bot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.