From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751892AbcFYElm (ORCPT ); Sat, 25 Jun 2016 00:41:42 -0400 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> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-SPF: eid=1bGfPO-0001Mv-MN;;;mid=<878txt3n8f.fsf@x220.int.ebiederm.org>;;;hst=in02.mta.xmission.com;;;ip=67.3.204.119;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX1+JqXGv2qU6Mh+tOLzP9O75VO9q8kJrrJE= X-SA-Exim-Connect-IP: 67.3.204.119 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.0 TVD_RCVD_IP Message was received from an IP address * 0.0 T_TM2_M_HEADER_IN_MSG BODY: No description available. * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.4998] * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa07 1397; Body=1 Fuz1=1 Fuz2=1] X-Spam-DCC: XMission; sa07 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: ;Jann Horn X-Spam-Relay-Country: X-Spam-Timing: total 1223 ms - load_scoreonly_sql: 0.04 (0.0%), signal_user_changed: 4.4 (0.4%), b_tie_ro: 3.1 (0.3%), parse: 0.88 (0.1%), extract_message_metadata: 3.2 (0.3%), get_uri_detail_list: 1.15 (0.1%), tests_pri_-1000: 3.4 (0.3%), tests_pri_-950: 1.17 (0.1%), tests_pri_-900: 0.97 (0.1%), tests_pri_-400: 18 (1.5%), check_bayes: 17 (1.4%), b_tokenize: 4.4 (0.4%), b_tok_get_all: 6 (0.5%), b_comp_prob: 1.49 (0.1%), b_tok_touch_all: 3.0 (0.2%), b_finish: 0.79 (0.1%), tests_pri_0: 1175 (96.1%), check_dkim_signature: 0.45 (0.0%), check_dkim_adsp: 3.4 (0.3%), tests_pri_500: 5 (0.4%), rewrite_mail: 0.00 (0.0%) Subject: Re: [PATCH] orangefs: fix namespace handling X-Spam-Flag: No X-SA-Exim-Version: 4.2.1 (built Thu, 05 May 2016 13:38:54 -0600) X-SA-Exim-Scanned: Yes (on in02.mta.xmission.com) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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