Editing
Patch-3.14.17-vs2.3.6.13-userns.diff
From Linix VServer
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
diff -urNpd linux-3.14.22-vs2.3.6.13~/include/linux/uidgid.h linux-3.14.22-vs2.3.6.13/include/linux/uidgid.h --- linux-3.14.22-vs2.3.6.13~/include/linux/uidgid.h 2014-10-15 21:33:01.000000000 -0500 +++ linux-3.14.22-vs2.3.6.13/include/linux/uidgid.h 2014-10-15 21:36:39.000000000 -0500 @@ -130,7 +130,7 @@ static inline bool tag_valid(ktag_t tag) extern kuid_t make_kuid(struct user_namespace *from, uid_t uid); extern kgid_t make_kgid(struct user_namespace *from, gid_t gid); -extern krag_t make_ktag(struct user_namespace *from, gid_t gid); +extern ktag_t make_ktag(struct user_namespace *from, vtag_t tag); extern uid_t from_kuid(struct user_namespace *to, kuid_t uid); extern gid_t from_kgid(struct user_namespace *to, kgid_t gid); --- linux-3.14.22-vs2.3.6.14~/kernel/user_namespace.c 2014-10-15 21:33:01.000000000 -0500 +++ linux-3.14.22-vs2.3.6.14/kernel/user_namespace.c 2014-10-25 15:20:12.000000000 -0500 @@ -352,6 +352,18 @@ gid_t from_kgid_munged(struct user_names } EXPORT_SYMBOL(from_kgid_munged); +ktag_t make_ktag(struct user_namespace *from, vtag_t tag) +{ + return KTAGT_INIT(tag); +} +EXPORT_SYMBOL(make_ktag); + +vtag_t from_ktag(struct user_namespace *to, ktag_t tag) +{ + return __ktag_val(tag); +} +EXPORT_SYMBOL(from_ktag); + /** * make_kprojid - Map a user-namespace projid pair into a kprojid. * @ns: User namespace that the projid is in diff -urpd linux-3.14.22-vs2.3.6.14~/kernel/vserver/space.c linux-3.14.22-vs2.3.6.14/kernel/vserver/space.c --- linux-3.14.22-vs2.3.6.14~/kernel/vserver/space.c 2014-10-15 21:33:01.000000000 -0500 +++ linux-3.14.22-vs2.3.6.14/kernel/vserver/space.c 2014-10-27 01:36:37.000000000 -0500 @@ -88,7 +88,7 @@ static const struct vcmd_space_mask_v1 d CLONE_NEWIPC | #endif #ifdef CONFIG_USER_NS - CLONE_NEWUSER | +// CLONE_NEWUSER | #endif #ifdef CONFIG_PID_NS // CLONE_NEWPID | diff -urpd linux-3.14.22-vs2.3.6.14~/kernel/vserver/switch.c linux-3.14.22-vs2.3.6.14/kernel/vserver/switch.c --- linux-3.14.22-vs2.3.6.14~/kernel/vserver/switch.c 2014-10-15 21:33:01.000000000 -0500 +++ linux-3.14.22-vs2.3.6.14/kernel/vserver/switch.c 2014-10-27 01:18:15.000000000 -0500 @@ -435,19 +435,20 @@ long do_vserver(uint32_t cmd, uint32_t i goto out; state = 1; - if (!capable(CAP_CONTEXT)) + if (!ns_capable(current_user_ns(), CAP_CONTEXT)) goto out; state = 2; /* moved here from the individual commands */ ret = -EPERM; - if ((perm > 1) && !capable(CAP_SYS_ADMIN)) + if ((perm > 1) && !ns_capable(current_user_ns(), CAP_SYS_ADMIN)) goto out; state = 3; /* vcmd involves resource management */ ret = -EPERM; - if ((flags & VCF_ARES) && !capable(CAP_SYS_RESOURCE)) + if ((flags & VCF_ARES) && + !ns_capable(current_user_ns(), CAP_SYS_RESOURCE)) goto out; state = 4;
Summary:
Please note that all contributions to Linix VServer may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Linix VServer:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Page actions
Page
Discussion
Read
Edit
History
Page actions
Page
Discussion
More
Tools
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
About
Overview
Paper
News
Developers
Donations
Search
Getting Started
Downloads
FAQs
Documentation
Support
Participate
How to participate
Report a Bug
Communicate
Teams/Projects
Hall of Fame
Resources
Archives
Recent Wiki Changes
Pastebin
Related Projects
VServer Hosting
Happy VServer Users
Tools
What links here
Related changes
Special pages
Page information