1 // SPDX-License-Identifier: GPL-2.0-or-later 2 /* 3 * Copyright (c) 2023 Huawei Device Co., Ltd. 4 */ 5 6 #include "ced_detection.h" 7 #include "ced_log.h" 8 switch_task_namespaces_permission_hook(const struct nsproxy * new,int * ret)9void switch_task_namespaces_permission_hook(const struct nsproxy *new, int *ret) 10 { 11 *ret = 0; 12 if (new == NULL) 13 return; 14 15 if (ced_has_check_perm()) { 16 *ret = -EPERM; 17 ced_log_error("switch task namespace is not permitted in container process"); 18 return; 19 } 20 }