From: Serge Hallyn <serge.hallyn-GeWIH/nMZzLQT0dZR+AlfA@public.gmane.org>
To: Chen Hanxiao <chenhanxiao-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
Cc: Fabian Frederick <fabf-AgBVmzD5pcezQB+pC5nmwQ@public.gmane.org>,
containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
Oleg Nesterov <oleg-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
"Eric W. Biederman"
<ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
Subject: Re: [RESEND][PATCH] userns: use marco instead of magic number for max userns level
Date: Thu, 11 Sep 2014 16:30:48 +0000 [thread overview]
Message-ID: <20140911163048.GF24386@ubuntumail> (raw)
In-Reply-To: <1410429091-7234-1-git-send-email-chenhanxiao-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
Quoting Chen Hanxiao (chenhanxiao-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org):
> Use marco instead of magic number
> for max user namespace level.
>
> Signed-off-by: Chen Hanxiao <chenhanxiao-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
Acked-by: Serge E. Hallyn <serge.hallyn-GeWIH/nMZzLQT0dZR+AlfA@public.gmane.org>
> ---
> kernel/user_namespace.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/kernel/user_namespace.c b/kernel/user_namespace.c
> index aa312b0..5435489 100644
> --- a/kernel/user_namespace.c
> +++ b/kernel/user_namespace.c
> @@ -47,6 +47,8 @@ static void set_cred_user_ns(struct cred *cred, struct user_namespace *user_ns)
> cred->user_ns = user_ns;
> }
>
> +#define MAX_USER_NS_LEVEL 32
> +
> /*
> * Create a new user namespace, deriving the creator from the user in the
> * passed credentials, and replacing that user with the new root user for the
> @@ -62,7 +64,7 @@ int create_user_ns(struct cred *new)
> kgid_t group = new->egid;
> int ret;
>
> - if (parent_ns->level > 32)
> + if (parent_ns->level > MAX_USER_NS_LEVEL)
> return -EUSERS;
>
> /*
> --
> 1.9.0
>
> _______________________________________________
> Containers mailing list
> Containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
> https://lists.linuxfoundation.org/mailman/listinfo/containers
WARNING: multiple messages have this Message-ID (diff)
From: Serge Hallyn <serge.hallyn@ubuntu.com>
To: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
Cc: containers@lists.linux-foundation.org,
linux-kernel@vger.kernel.org, Fabian Frederick <fabf@skynet.be>,
"Eric W. Biederman" <ebiederm@xmission.com>,
Oleg Nesterov <oleg@redhat.com>
Subject: Re: [RESEND][PATCH] userns: use marco instead of magic number for max userns level
Date: Thu, 11 Sep 2014 16:30:48 +0000 [thread overview]
Message-ID: <20140911163048.GF24386@ubuntumail> (raw)
In-Reply-To: <1410429091-7234-1-git-send-email-chenhanxiao@cn.fujitsu.com>
Quoting Chen Hanxiao (chenhanxiao@cn.fujitsu.com):
> Use marco instead of magic number
> for max user namespace level.
>
> Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
> ---
> kernel/user_namespace.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/kernel/user_namespace.c b/kernel/user_namespace.c
> index aa312b0..5435489 100644
> --- a/kernel/user_namespace.c
> +++ b/kernel/user_namespace.c
> @@ -47,6 +47,8 @@ static void set_cred_user_ns(struct cred *cred, struct user_namespace *user_ns)
> cred->user_ns = user_ns;
> }
>
> +#define MAX_USER_NS_LEVEL 32
> +
> /*
> * Create a new user namespace, deriving the creator from the user in the
> * passed credentials, and replacing that user with the new root user for the
> @@ -62,7 +64,7 @@ int create_user_ns(struct cred *new)
> kgid_t group = new->egid;
> int ret;
>
> - if (parent_ns->level > 32)
> + if (parent_ns->level > MAX_USER_NS_LEVEL)
> return -EUSERS;
>
> /*
> --
> 1.9.0
>
> _______________________________________________
> Containers mailing list
> Containers@lists.linux-foundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/containers
next prev parent reply other threads:[~2014-09-11 16:30 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-11 9:51 [RESEND][PATCH] userns: use marco instead of magic number for max userns level Chen Hanxiao
2014-09-11 9:51 ` Chen Hanxiao
[not found] ` <1410429091-7234-1-git-send-email-chenhanxiao-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2014-09-11 16:30 ` Serge Hallyn [this message]
2014-09-11 16:30 ` Serge Hallyn
2014-09-11 18:17 ` Aristeu Rozanski
2014-09-11 18:17 ` Aristeu Rozanski
[not found] ` <20140911181741.GU22290-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-09-12 1:54 ` Chen, Hanxiao
2014-09-12 1:54 ` Chen, Hanxiao
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=20140911163048.GF24386@ubuntumail \
--to=serge.hallyn-gewih/nmzzlqt0dzr+alfa@public.gmane.org \
--cc=chenhanxiao-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org \
--cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
--cc=ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org \
--cc=fabf-AgBVmzD5pcezQB+pC5nmwQ@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=oleg-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.