History

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace

Pull namespace changes from Eric Biederman: "This is an assorted mishmash of small cleanups, enhancements and bug fixes. The major theme is user namespace mount restrictions. nsown_capable is killed as it encourages not thinking about details that need to be considered. A very hard to hit pid namespace exiting bug was finally tracked and fixed. A couple of cleanups to the basic namespace infrastructure. Finally there is an enhancement that makes per user namespace capabilities usable as capabilities, and an enhancement that allows the per userns root to nice other processes in the user namespace" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace: userns: Kill nsown_capable it makes the wrong thing easy capabilities: allow nice if we are privileged pidns: Don't have unshare(CLONE_NEWPID) imply CLONE_THREAD userns: Allow PR_CAPBSET_DROP in a user namespace. namespaces: Simplify copy_namespaces so it is clear what is going on. pidns: Fix hang in zap_pid_ns_processes by sending a potentially extra wakeup sysfs: Restrict mounting sysfs userns: Better restrictions on when proc and sysfs can be mounted vfs: Don't copy mount bind mounts of /proc/<pid>/ns/mnt between namespaces kernel/nsproxy.c: Improving a snippet of code. proc: Restrict mounting the proc filesystem vfs: Lock in place mounts from more privileged users

Linus Torvalds committed 13 years ago

Commit c7c45912 parents 11c7b03 c7b96ac27 files · +177 −104Browse files

Showing the changes to lib (1 of 27 files). Show all

Unified · Split

lib/kobject.c+15−0
@@ -931,6 +931,21 @@ const struct kobj_ns_type_operations *kobj_ns_ops(struct kobject *kobj) · 930 unmodified lines
931931 return kobj_child_ns_ops(kobj->parent);
932932 }
933933
934+bool kobj_ns_current_may_mount(enum kobj_ns_type type)
935+{
936+ bool may_mount = false;
937+
938+ if (type == KOBJ_NS_TYPE_NONE)
939+ return true;
940+
941+ spin_lock(&kobj_ns_type_lock);
942+ if ((type > KOBJ_NS_TYPE_NONE) && (type < KOBJ_NS_TYPES) &&
943+ kobj_ns_ops_tbl[type])
944+ may_mount = kobj_ns_ops_tbl[type]->current_may_mount();
945+ spin_unlock(&kobj_ns_type_lock);
946+
947+ return may_mount;
948+}
934949
935950 void *kobj_ns_grab_current(enum kobj_ns_type type)
936951 {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t