Return-Path: Received: from out02.mta.xmission.com ([166.70.13.232]:57238 "EHLO out02.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751091AbcFYElj (ORCPT ); Sat, 25 Jun 2016 00:41:39 -0400 From: ebiederm@xmission.com (Eric W. Biederman) To: Jann Horn Cc: Mike Marshall , linux-kernel@vger.kernel.org, Alexander Viro , linux-fsdevel@vger.kernel.org, jann@thejh.net References: <1466812312-26093-1-git-send-email-jannh@google.com> Date: Fri, 24 Jun 2016 23:29:20 -0500 In-Reply-To: <1466812312-26093-1-git-send-email-jannh@google.com> (Jann Horn's message of "Sat, 25 Jun 2016 01:51:52 +0200") Message-ID: <878txt3n8f.fsf@x220.int.ebiederm.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [PATCH] orangefs: fix namespace handling Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Jann Horn writes: > diff --git a/fs/orangefs/devorangefs-req.c b/fs/orangefs/devorangefs-req.c > index db170be..a287a66 100644 > --- a/fs/orangefs/devorangefs-req.c > +++ b/fs/orangefs/devorangefs-req.c > @@ -116,6 +116,13 @@ static int orangefs_devreq_open(struct inode *inode, struct file *file) > { > int ret = -EINVAL; > > + /* in order to ensure that the filesystem driver sees correct UIDs */ > + if (file->f_cred->user_ns != &init_user_ns) { > + gossip_err("%s: device cannot be opened outside init_user_ns\n", > + __func__); > + goto out; > + } > + Not necessarily in this patch but the code should also verify that the opener is also in the initial pid namespace as pids are transferred in the upcalls as well. > if (!(file->f_flags & O_NONBLOCK)) { > gossip_err("%s: device cannot be opened in blocking mode\n", > __func__); Eric