mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Robert Foss <robert.foss@collabora.com>
To: peterz@infradead.org, mingo@redhat.com, linux-kernel@vger.kernel.org
Cc: Robert Foss <robert.foss@collabora.com>
Subject: [PATCH RESEND v1] locking/ww_mutex: Prevent read of uninitialized memory
Date: Tue, 14 Mar 2017 15:44:02 -0400	[thread overview]
Message-ID: <20170314194402.15834-1-robert.foss@collabora.com> (raw)

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

             reply	other threads:[~2017-03-14 19:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-14 19:44 Robert Foss [this message]
2017-03-14 21:48 ` Chris Wilson
2017-03-17  1:50 ` kbuild test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170314194402.15834-1-robert.foss@collabora.com \
    --to=robert.foss@collabora.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®