Return-Path: linux-nfs-owner@vger.kernel.org Received: from mout.gmx.net ([212.227.17.22]:64417 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752390Ab3IVRDs (ORCPT ); Sun, 22 Sep 2013 13:03:48 -0400 Received: from [80.171.221.199] ([80.171.221.199]) by mail.gmx.com (mrgmx103) with ESMTPSA (Nemesis) id 0MNIO5-1VGwVn22sD-006yBz for ; Sun, 22 Sep 2013 19:03:46 +0200 Message-ID: <523F22EA.2050609@gmx.de> Date: Sun, 22 Sep 2013 19:03:38 +0200 From: =?UTF-8?B?VG9yYWxmIEbDtnJzdGVy?= MIME-Version: 1.0 To: Oleg Nesterov CC: "Serge E. Hallyn" , Andrey Vagin , "Eric W. Biederman" , Al Viro , Linux NFS mailing list Subject: Re: fuzz tested user mode linux core dumps in fs/lockd/clntproc.c:131 References: <51F39AE8.3090401@gmx.de> <20130727170051.GA31447@redhat.com> In-Reply-To: <20130727170051.GA31447@redhat.com> Content-Type: text/plain; charset=UTF-8 Sender: linux-nfs-owner@vger.kernel.org List-ID: On 07/27/2013 07:00 PM, Oleg Nesterov wrote: > On 07/27, Toralf Förster wrote: >> >> I do have a user mode linux image (stable 32 bit Gentoo Linux ) which erratically crashes >> while fuzz tested with trinity if the victim files are located on a NFS share. >> >> The back trace of the core dumps always looks like the attached. >> >> To bisect it is hard. However after few attempts in the last weeks the following >> commit is either the first bad commit or at least the upper limit (less likely). >> >> >> commit 8aac62706adaaf0fab02c4327761561c8bda9448 >> Author: Oleg Nesterov >> Date: Fri Jun 14 21:09:49 2013 +0200 >> >> move exit_task_namespaces() outside of exit_notify() >> >> #15 nlmclnt_setlockargs (req=0x48e18860, fl=0x48f27c8c) at fs/lockd/clntproc.c:131 > > Thanks. > > So nlmclnt_setlockargs()->utsname() crashes and we probably need > the patch below. > > But is it correct? I know _absolutely_ nothing about nfs/sunrpc/etc and > I never looked into this code before, most probably I am wrong. > > But it seems that __nlm_async_call() relies on workqueues. > nlmclnt_async_call() does rpc_wait_for_completion_task(), but what if > the caller is killed? > > nlm_rqst can't go away, ->a_count was incremented. But can't the caller > exit before call->name is used? In this case the memory it points to > can be already freed. > > Oleg. > > --- x/kernel/exit.c > +++ x/kernel/exit.c > @@ -783,8 +783,8 @@ void do_exit(long code) > exit_shm(tsk); > exit_files(tsk); > exit_fs(tsk); > - exit_task_namespaces(tsk); > exit_task_work(tsk); > + exit_task_namespaces(tsk); > check_stack_usage(); > exit_thread(); > > > /me wonders if/when this will go in the main kernel ? -- MfG/Sincerely Toralf Förster pgp finger print: 7B1A 07F4 EC82 0F90 D4C2 8936 872A E508 7DB6 9DA3