public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Stanislav Kinsbursky <skinsbursky@parallels.com>
To: Oleg Nesterov <oleg@redhat.com>
Cc: <akpm@linux-foundation.org>, <jlayton@redhat.com>,
	<lucas.demarchi@profusion.mobi>, <rusty@rustcorp.com.au>,
	<linux-kernel@vger.kernel.org>, <bfields@fieldses.org>,
	<viro@zeniv.linux.org.uk>, <bharrosh@panasas.com>,
	<devel@openvz.org>
Subject: Re: [RFC PATCH] kmod: add ability to swap root in usermode helper
Date: Mon, 20 May 2013 18:43:31 +0400	[thread overview]
Message-ID: <519A3693.8020006@parallels.com> (raw)
In-Reply-To: <20130520135716.GA10084@redhat.com>

20.05.2013 17:57, Oleg Nesterov пишет:
> On 05/20, Stanislav Kinsbursky wrote:
>>
>> Usermode helper executes all binaries in global "init" root context. This
>> doesn't allow to call to call the binary from other root (for example in a
>> container).
>> Currently, containerized NFS server requires an ability to execute a binary in
>> a other context, than "init" root (UMH is used for client recovery tracking).
>> This patch adds root swap to ____call_usermodehelper(), if non-NULL root was
>> passed as a part of subprocess_info data,
>
> Why do we need the new member/arguments?
>
>> @@ -215,6 +216,9 @@ static int ____call_usermodehelper(void *data)
>>   	 */
>>   	set_user_nice(current, 0);
>>
>> +	if (sub_info->root)
>> +		set_fs_root(current->fs, sub_info->root);
>
> Can't subprocess_info->init() do this? You can pass root as ->data.
>
> IOW, unless I missed something, nfs can do this without any changes
> in kmod.c.
>
> Oleg.
>

Thanks for the comment.
Yes, it definitely can. But, NFS server in the the only place. Usermode helper in
called from NFS client code and thus the same functionality is required there as well.
Moreover, set_fs_root() is not exported.
And adding an ability of a root swap to usermode helper looks quite logical. At least from the
"containers" point of view, which usually have it's own root.

-- 
Best regards,
Stanislav Kinsbursky

  reply	other threads:[~2013-05-20 14:43 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-20  7:00 [RFC PATCH] kmod: add ability to swap root in usermode helper Stanislav Kinsbursky
2013-05-20  8:42 ` Jeff Layton
2013-05-20  8:56   ` Stanislav Kinsbursky
2013-05-20 13:57 ` Oleg Nesterov
2013-05-20 14:43   ` Stanislav Kinsbursky [this message]
2013-05-20 15:10     ` Oleg Nesterov
2013-05-20 21:24       ` J. Bruce Fields
2013-05-21 15:28         ` Oleg Nesterov
2013-05-21 15:35           ` J. Bruce Fields
2013-05-21 16:29             ` Oleg Nesterov
2013-05-22  6:00               ` Stanislav Kinsbursky
2013-05-21  5:50 ` Rusty Russell

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=519A3693.8020006@parallels.com \
    --to=skinsbursky@parallels.com \
    --cc=akpm@linux-foundation.org \
    --cc=bfields@fieldses.org \
    --cc=bharrosh@panasas.com \
    --cc=devel@openvz.org \
    --cc=jlayton@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lucas.demarchi@profusion.mobi \
    --cc=oleg@redhat.com \
    --cc=rusty@rustcorp.com.au \
    --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