Return-Path: linux-nfs-owner@vger.kernel.org Received: from mx1.redhat.com ([209.132.183.28]:34188 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751756Ab3G2SIW (ORCPT ); Mon, 29 Jul 2013 14:08:22 -0400 Date: Mon, 29 Jul 2013 20:03:01 +0200 From: Oleg Nesterov To: "Eric W. Biederman" Cc: Toralf =?iso-8859-1?Q?F=F6rster?= , "Serge E. Hallyn" , Andrey Vagin , Al Viro , Linux NFS mailing list , Stanislav Kinsbursky , "J. Bruce Fields" Subject: Re: fuzz tested user mode linux core dumps in fs/lockd/clntproc.c:131 (nfs in a netns utsns problems?) Message-ID: <20130729180301.GA27148@redhat.com> References: <51F39AE8.3090401@gmx.de> <20130727170051.GA31447@redhat.com> <87iozujkdy.fsf@xmission.com> <87r4eii4td.fsf@xmission.com> <20130729141758.GA8505@redhat.com> <871u6h45zy.fsf_-_@xmission.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <871u6h45zy.fsf_-_@xmission.com> Sender: linux-nfs-owner@vger.kernel.org List-ID: On 07/29, Eric W. Biederman wrote: > > So I really don't think using utsname() aka current->nsproxy->uts_ns > makes sense in nlmclnt_setlockargs. > > We most definitely have an inconsistency in nfs. I tend to agree, but can't really comment. > > Yes. And perhaps the patch which moves exit_task_namespaces() after > > exit_task_work() makes sense anyway (the patch I showed). > > > > (but if you change nlmclnt_setlockargs() then it is not 3.11 material). > > > > The original motivation for 8aac62706 was the leak reported by Andrey, > > but that leak should be also fixed by e7b2c406. "Move exit_task_namespaces() > > from exit_notify() to do_exit()" is still fine imho, the reason for > > exit_task_namespaces() from the middle of exit_notify() has gone away. > > > > But perhaps it would be better if work->func() could use ->nsproxy even > > if the task is PF_EXITING. > > So far there is nothing in the nfs code that would suggest allowing > work->func() being able to use ->nsproxy would make this code any > better. I think that would just paper over the problem we are seeing > right now. I think you misunderstood my point. I fully agree if you change nlmclnt_setlockargs(). I am suggesting to move exit_task_namespaces() down after exit_task_work() as a separate change which perhaps makes sense by itself. Not to fix this problem, not for nfs, not for fput(). Just to allow work->func() to play with ->nsproxy if needed. task_work has other users, not only fput(). Oleg.