From: Evgeny Kuznetsov <EXT-Eugeny.Kuznetsov@nokia.com>
To: akpm@linux-foundation.org, torvalds@linux-foundation.org
Cc: m.nazarewicz@samsung.com, mingo@elte.hu, gregkh@suse.de,
a.p.zijlstra@chello.nl, xiaosuo@gmail.com,
linux-kernel@vger.kernel.org, ext-eugeny.kuznetsov@nokia.com
Subject: [PATCH 1/1] wait: using uninitialized member of wait queue
Date: Tue, 5 Oct 2010 12:47:57 +0400 [thread overview]
Message-ID: <dfd3348b7971bee89360efb85f8d622e6574b003.1286193121.git.EXT-Eugeny.Kuznetsov@nokia.com> (raw)
In-Reply-To: <cover.1286193121.git.EXT-Eugeny.Kuznetsov@nokia.com>
In-Reply-To: <cover.1286193121.git.EXT-Eugeny.Kuznetsov@nokia.com>
From: Evgeny Kuznetsov <ext-eugeny.kuznetsov@nokia.com>
Member "flags" of "wait_queue_t" struct is used in several places in
kernel code without beeing initialized. "flags" is used in bitwise operations.
If "flags" not initialized then unexpected behaviour may have place.
Incorrect flags maybe used later in code.
Struct "wait_queue_t" is initialized in function "init_wait()". But
"init_wait()" do not initialize "flag" member.
Added initialization of "wait_queue_t.flags" with zero value into "init_wait".
Signed-off-by: Evgeny Kuznetsov <EXT-Eugeny.Kuznetsov@nokia.com>
---
include/linux/wait.h | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/include/linux/wait.h b/include/linux/wait.h
index 0836ccc..3efc9f3 100644
--- a/include/linux/wait.h
+++ b/include/linux/wait.h
@@ -614,6 +614,7 @@ int wake_bit_function(wait_queue_t *wait, unsigned mode, int sync, void *key);
(wait)->private = current; \
(wait)->func = autoremove_wake_function; \
INIT_LIST_HEAD(&(wait)->task_list); \
+ (wait)->flags = 0; \
} while (0)
/**
--
1.6.3.3
next prev parent reply other threads:[~2010-10-05 8:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-05 8:47 [PATCH 0/1] " Evgeny Kuznetsov
2010-10-05 8:47 ` Evgeny Kuznetsov [this message]
2010-10-05 10:41 ` [PATCH 1/1] " Michał Nazarewicz
2010-10-05 11:00 ` Evgeny Kuznetsov
2010-10-05 11:39 ` Michał Nazarewicz
2010-10-05 15:43 ` [PATCH 0/1] " Linus Torvalds
2010-10-06 6:01 ` Evgeny Kuznetsov
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=dfd3348b7971bee89360efb85f8d622e6574b003.1286193121.git.EXT-Eugeny.Kuznetsov@nokia.com \
--to=ext-eugeny.kuznetsov@nokia.com \
--cc=a.p.zijlstra@chello.nl \
--cc=akpm@linux-foundation.org \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=m.nazarewicz@samsung.com \
--cc=mingo@elte.hu \
--cc=torvalds@linux-foundation.org \
--cc=xiaosuo@gmail.com \
/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®