From: Andrew Vagin <avagin@parallels.com>
To: Oleg Nesterov <oleg@redhat.com>
Cc: "Toralf Förster" <toralf.foerster@gmx.de>,
"Andrey Vagin" <avagin@openvz.org>,
"Serge E. Hallyn" <serue@us.ibm.com>,
"Eric W. Biederman" <ebiederm@xmission.com>,
"Al Viro" <viro@zeniv.linux.org.uk>,
"Linux NFS mailing list" <linux-nfs@vger.kernel.org>
Subject: Re: fuzz tested user mode linux core dumps in fs/lockd/clntproc.c:131
Date: Mon, 29 Jul 2013 18:27:49 +0400 [thread overview]
Message-ID: <20130729142749.GA27205@paralelels.com> (raw)
In-Reply-To: <20130729131031.GA6157@redhat.com>
On Mon, Jul 29, 2013 at 03:10:31PM +0200, Oleg Nesterov wrote:
> On 07/29, Andrew Vagin wrote:
> >
> > On Sun, Jul 28, 2013 at 07:58:28PM +0200, Oleg Nesterov wrote:
> > > On 07/28, Toralf Förster wrote:
> > > >
> > > > The attached patch works - applied on top of current git -
> > > > at least the issue cannot be reproduced then.
> > >
> > > Thanks Toralf.
> > >
> > > I'll write the changelog and send the patch tomorrow.
> > >
> > > Andrey, any chance you can check that with this patch free_ipc_ns()
> > > doesn't have any problem with ->shm_file ?
> >
> > kmemleak doesn't detect any leak,
>
> Good.
>
> > but I think this patch is incorrect.
> >
> > According to my previous investigations exit_task_work should be called
> > after exit task namespaces
> > (http://comments.gmane.org/gmane.linux.kernel/1475123)
> >
> > I applied the following patch:
> >
> > @@ -11,8 +11,11 @@ task_work_add(struct task_struct *task, struct
> > callback_head *work, bool notify)
> >
> > do {
> > head = ACCESS_ONCE(task->task_works);
> > - if (unlikely(head == &work_exited))
> > + if (unlikely(head == &work_exited)) {
> > + printk("%s:%d\n", __func__, __LINE__);
> > + dump_stack();
> > return -ESRCH;
> > + }
> > work->next = head;
> > } while (cmpxchg(&task->task_works, head, work) != head);
> >
> >
> > and I got a few backtraces in a kernel log
> >
> > [ 151.513725] task_work_add:15
> > [ 151.514860] CPU: 1 PID: 15303 Comm: ipc Not tainted 3.11.0-rc2+ #75
> > [ 151.516743] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
> > [ 151.518558] ffff880067bf0000 ffff88006922fba0 ffffffff81630dd5 ffff88006d9b2280
> > [ 151.521767] ffff88006922fbb0 ffffffff8107b478 ffff88006922fbd0 ffffffff8119ad43
> > [ 151.524587] ffff880079e81740 ffff88007a9035c8 ffff88006922fbe8 ffffffff81281ebd
> > [ 151.527785] Call Trace:
> > [ 151.528811] [<ffffffff81630dd5>] dump_stack+0x45/0x56
> > [ 151.530378] [<ffffffff8107b478>] task_work_add+0x78/0x80
> > [ 151.533219] [<ffffffff8119ad43>] fput+0x63/0xa0
>
> But this is fine?
Yes.
>
> Once again, we also have e7b2c406 "fput: task_work_add() can fail if the caller
> has passed exit_task_work()" commit which should also fix this particulat problem.
Sorry, I skipped e7b2c406, which explains why I don't see leak now.
Thanks.
I don't have objections against this patch. All my tests work find.
next prev parent reply other threads:[~2013-07-29 14:31 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-27 10:03 fuzz tested user mode linux core dumps in fs/lockd/clntproc.c:131 Toralf Förster
2013-07-27 17:00 ` Oleg Nesterov
2013-07-27 17:27 ` Oleg Nesterov
2013-07-28 15:26 ` Toralf Förster
2013-07-28 17:58 ` Oleg Nesterov
2013-07-29 6:29 ` Andrew Vagin
2013-07-29 13:10 ` Oleg Nesterov
2013-07-29 14:27 ` Andrew Vagin [this message]
2013-07-29 14:51 ` Oleg Nesterov
2013-07-29 15:43 ` Andrey Vagin
2013-07-29 0:10 ` Eric W. Biederman
2013-07-29 0:32 ` Eric W. Biederman
2013-07-29 14:17 ` Oleg Nesterov
2013-07-29 17:42 ` fuzz tested user mode linux core dumps in fs/lockd/clntproc.c:131 (nfs in a netns utsns problems?) Eric W. Biederman
2013-07-29 18:03 ` Oleg Nesterov
2013-07-29 18:17 ` Eric W. Biederman
2013-07-30 21:12 ` J. Bruce Fields
2013-07-30 21:20 ` Myklebust, Trond
2013-09-22 17:03 ` fuzz tested user mode linux core dumps in fs/lockd/clntproc.c:131 Toralf Förster
2013-09-22 17:52 ` Oleg Nesterov
-- strict thread matches above, loose matches on Subject: below --
2013-07-27 9:53 Toralf Förster
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=20130729142749.GA27205@paralelels.com \
--to=avagin@parallels.com \
--cc=avagin@openvz.org \
--cc=ebiederm@xmission.com \
--cc=linux-nfs@vger.kernel.org \
--cc=oleg@redhat.com \
--cc=serue@us.ibm.com \
--cc=toralf.foerster@gmx.de \
--cc=viro@zeniv.linux.org.uk \
/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).