mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH RESEND v1] locking/ww_mutex: Prevent read of uninitialized memory
@ 2017-03-14 19:44 Robert Foss
  2017-03-14 21:48 ` Chris Wilson
  2017-03-17  1:50 ` kbuild test robot
  0 siblings, 2 replies; 3+ messages in thread
From: Robert Foss @ 2017-03-14 19:44 UTC (permalink / raw)
  To: peterz, mingo, linux-kernel; +Cc: Robert Foss

On "missed ABBA deadlock" abba.result is read, but not initialized
in all situations.

Detected by CoverityScan, CID#1402035 ("Uninitialized scalar variable")

Signed-off-by: Robert Foss <robert.foss@collabora.com>
---
 kernel/locking/test-ww_mutex.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/locking/test-ww_mutex.c b/kernel/locking/test-ww_mutex.c
index 6b7abb334ca6..beb76693ccfa 100644
--- a/kernel/locking/test-ww_mutex.c
+++ b/kernel/locking/test-ww_mutex.c
@@ -196,7 +196,7 @@ static void test_abba_work(struct work_struct *work)
 
 static int test_abba(bool resolve)
 {
-	struct test_abba abba;
+	struct test_abba abba = { 0 };
 	struct ww_acquire_ctx ctx;
 	int err, ret;
 
-- 
2.11.0.453.g787f75f05

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

end of thread, other threads:[~2017-03-17  1:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-14 19:44 [PATCH RESEND v1] locking/ww_mutex: Prevent read of uninitialized memory Robert Foss
2017-03-14 21:48 ` Chris Wilson
2017-03-17  1:50 ` kbuild test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®