From: Dave Jones <davej@redhat.com>
To: Oleg Nesterov <oleg@redhat.com>
Cc: Linux Kernel <linux-kernel@vger.kernel.org>,
roland@hack.frob.com,
Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: do_wait: Add missing tasklist unlocking in error paths.
Date: Fri, 20 Sep 2013 13:03:22 -0400 [thread overview]
Message-ID: <20130920170322.GA762@redhat.com> (raw)
In-Reply-To: <20130920164144.GA31808@redhat.com>
On Fri, Sep 20, 2013 at 06:41:44PM +0200, Oleg Nesterov wrote:
> On 09/20, Dave Jones wrote:
> >
> > It looks like both 64a16caf5, and 98abed020 both introduced error paths to do_wait
> > where we miss unlocking the tasklist.
> >
> > Spotted with coverity.
>
> Not really, afaics.
>
> > --- a/kernel/exit.c
> > +++ b/kernel/exit.c
> > @@ -1526,13 +1526,15 @@ repeat:
> > tsk = current;
> > do {
> > retval = do_wait_thread(wo, tsk);
> > - if (retval)
> > + if (retval) {
> > + read_unlock(&tasklist_lock);
>
> note that do_wait_thread() paths should drop tasklist if it returns non-zero.
Ah, I missed the unlock in wait_task_continued.
I'm not sure why the checker didn't infer that. Perhaps it thinks it's possible we
can get take one of the early returns in that function before we do the tasklist unlock.
thanks,
Dave
prev parent reply other threads:[~2013-09-20 17:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-20 16:37 do_wait: Add missing tasklist unlocking in error paths Dave Jones
2013-09-20 16:41 ` Oleg Nesterov
2013-09-20 17:03 ` Dave Jones [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=20130920170322.GA762@redhat.com \
--to=davej@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=oleg@redhat.com \
--cc=roland@hack.frob.com \
--cc=torvalds@linux-foundation.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;
as well as URLs for NNTP newsgroup(s).