mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Jann Horn <jannh@google.com>
Cc: Mike Marshall <hubcap@omnibond.com>,
	linux-kernel@vger.kernel.org,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	linux-fsdevel@vger.kernel.org, jann@thejh.net
Subject: Re: [PATCH] orangefs: fix namespace handling
Date: Fri, 24 Jun 2016 23:29:20 -0500	[thread overview]
Message-ID: <878txt3n8f.fsf@x220.int.ebiederm.org> (raw)
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")

Jann Horn <jannh@google.com> 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

  reply	other threads:[~2016-06-25  4:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-24 23:51 Jann Horn
2016-06-25  4:29 ` Eric W. Biederman [this message]
2016-06-25 23:03   ` Mike Marshall

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=878txt3n8f.fsf@x220.int.ebiederm.org \
    --to=ebiederm@xmission.com \
    --cc=hubcap@omnibond.com \
    --cc=jann@thejh.net \
    --cc=jannh@google.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --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

all inboxes | Powered by JetHome®