
From: Zhang Tianxing <zhangtianxing3@huawei.com> hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I4O25G CVE: NA -------------------------------- This reverts commit 44a41d572da65f3975c5e36fe3270a7fdaabe821. Signed-off-by: Zhang Tianxing <zhangtianxing3@huawei.com> Acked-by: Xie XiuQi <xiexiuqi@huawei.com> Acked-by: Xiu Jianfeng<xiujianfeng@huawei.com> Signed-off-by: Zheng Zengkai <zhengzengkai@huawei.com> --- include/linux/user_namespace.h | 6 ------ kernel/user_namespace.c | 11 ----------- 2 files changed, 17 deletions(-) diff --git a/include/linux/user_namespace.h b/include/linux/user_namespace.h index 6cb6a455e7aa..3eb64a50f248 100644 --- a/include/linux/user_namespace.h +++ b/include/linux/user_namespace.h @@ -141,7 +141,6 @@ extern bool in_userns(const struct user_namespace *ancestor, const struct user_namespace *child); extern bool current_in_userns(const struct user_namespace *target_ns); struct ns_common *ns_get_owner(struct ns_common *ns); -extern bool userns_set_uidmap(const struct user_namespace *ns); #else static inline struct user_namespace *get_user_ns(struct user_namespace *ns) @@ -186,11 +185,6 @@ static inline struct ns_common *ns_get_owner(struct ns_common *ns) { return ERR_PTR(-EPERM); } - -static inline bool userns_set_uidmap(const struct user_namespace *ns) -{ - return true; -} #endif #endif /* _LINUX_USER_H */ diff --git a/kernel/user_namespace.c b/kernel/user_namespace.c index a57d52edbc31..2c15bf6680c3 100644 --- a/kernel/user_namespace.c +++ b/kernel/user_namespace.c @@ -1291,17 +1291,6 @@ bool current_in_userns(const struct user_namespace *target_ns) } EXPORT_SYMBOL(current_in_userns); -bool userns_set_uidmap(const struct user_namespace *ns) -{ - bool mapping_defined; - - mutex_lock(&userns_state_mutex); - mapping_defined = ns->uid_map.nr_extents != 0; - mutex_unlock(&userns_state_mutex); - - return mapping_defined; -} - static inline struct user_namespace *to_user_ns(struct ns_common *ns) { return container_of(ns, struct user_namespace, ns); -- 2.20.1