From: Oleg Nesterov <oleg@redhat.com>
To: Chen Gang <gang.chen@asianux.com>
Cc: Serge Hallyn <serge.hallyn@ubuntu.com>,
"Eric W. Biederman" <ebiederm@xmission.com>,
Serge Hallyn <serge.hallyn@canonical.com>,
Andy Lutomirski <luto@amacapital.net>,
"dhowells@redhat.com" <dhowells@redhat.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] kernel: user_namespace: always set the return parameter 'new_cred' when call unshare_userns() successfully.
Date: Wed, 21 Aug 2013 13:57:39 +0200 [thread overview]
Message-ID: <20130821115739.GA2965@redhat.com> (raw)
In-Reply-To: <52143EE0.3040604@asianux.com>
On 08/21, Chen Gang wrote:
>
> On 08/20/2013 10:37 PM, Oleg Nesterov wrote:
> > On 08/20, Serge Hallyn wrote:
> >>
> >>
> >> But the only existing caller (sys_unshare) does in fact initialize it to
> >> NULL. So while this patch does no harm, is it necessary?
> >
> > Agreed.
> >
> > Plus, with this patch unshare_userns() becomes "inconsistent" compared
> > to other unshare_ helpers.
> >
>
> Hmm... for static functions, they don't need, but for extern functions,
> recommend to do so.
>
>
> For "unshare_ helpers", I find 3 extern functions:
>
> unshare_files() which already set value.
> unshare_userns() and unshare_nsproxy_namespaces() which not set.
>
> In my opinion, recommend to always set the return parameter when
> succeed, for the 2 left extern functions.
I do not think that static/extern should make any difference. To me,
the cleanup should make unshare_userns() return "cred *" (or NULL or
ERR_PTR()) But this is subjective and in this case we should change
other unshare_ helpers too. Doesn't worth the trouble.
Oleg.
next prev parent reply other threads:[~2013-08-21 12:03 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-20 2:53 [PATCH] kernel: user_namespace: always set the return parameter 'new_cred' when call unshare_userns() successfully Chen Gang
2013-08-20 14:10 ` Serge Hallyn
2013-08-20 14:37 ` Oleg Nesterov
2013-08-21 4:15 ` Chen Gang
2013-08-21 11:57 ` Oleg Nesterov [this message]
2013-08-22 1:30 ` Chen Gang
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=20130821115739.GA2965@redhat.com \
--to=oleg@redhat.com \
--cc=dhowells@redhat.com \
--cc=ebiederm@xmission.com \
--cc=gang.chen@asianux.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=serge.hallyn@canonical.com \
--cc=serge.hallyn@ubuntu.com \
/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