mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Evgeny Kuznetsov <EXT-Eugeny.Kuznetsov@nokia.com>
To: ext Linus Torvalds <torvalds@linux-foundation.org>
Cc: akpm@linux-foundation.org, m.nazarewicz@samsung.com,
	mingo@elte.hu, gregkh@suse.de, a.p.zijlstra@chello.nl,
	xiaosuo@gmail.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/1] wait: using uninitialized member of wait queue
Date: Wed, 06 Oct 2010 10:01:31 +0400	[thread overview]
Message-ID: <1286344891.24366.59.camel@ekuznets-lx-nokia> (raw)
In-Reply-To: <AANLkTimEp8rorHxtOQji-xtXZoDkcYrGGWCBQg3ypKf4@mail.gmail.com>

On Tue, 2010-10-05 at 08:43 -0700, ext Linus Torvalds wrote:
> On Tue, Oct 5, 2010 at 1:47 AM, Evgeny Kuznetsov
> <EXT-Eugeny.Kuznetsov@nokia.com> wrote:
> >
> > Here is patch which fixes bug in /include/linux/wait.h file.
> > 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 it contain dummy data then incorrect flags may be
> > used later in code.
> 
> The patch looks fine, but do you have any case of this actually
> causing problems? Afaik, we do end up initializing the part of the
> flags field we care about (WQ_FLAG_EXCLUSIVE) in prepare_to_wait()
> (and add_wait_queue()), so it looks - from an admittedly very cursory
> read - as if this is a good cleanup but shouldn't actually be the
> cause of any actual bugs.
> 
> So I'll apply it, but I just wondered if you had actually seen any
> semantic changes from it?
> 
>                Linus
I did not see any problems caused by uninitialized flag. But this is
potential unsafe place (in case of future changes).
Also there is initialization of all members but not 'flags' in
init_wait() function. It is logical to initialize all data members.

Thanks,
Regards,
Evgeny


      reply	other threads:[~2010-10-06  6:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-05  8:47 Evgeny Kuznetsov
2010-10-05  8:47 ` [PATCH 1/1] " Evgeny Kuznetsov
2010-10-05 10:41   ` 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 [this message]

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=1286344891.24366.59.camel@ekuznets-lx-nokia \
    --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®