ns_capable
if (ns_capable(net->user_ns, CAP_NET_ADMIN))
return ns_capable(net->user_ns, CAP_NET_RAW);
if (!ns_capable(net->user_ns, CAP_NET_ADMIN))
if (!ns_capable(dev_net(ipvlan->phy_dev)->user_ns, CAP_NET_ADMIN))
if (!ns_capable(dev_net(phy_dev)->user_ns, CAP_NET_ADMIN))
if (!ns_capable(file->f_cred->user_ns, CAP_NET_ADMIN))
if (!ns_capable(net->user_ns, CAP_NET_ADMIN))
if (!ns_capable(net->user_ns, CAP_NET_ADMIN))
if (!ns_capable(net->user_ns, CAP_NET_ADMIN))
!ns_capable(net->user_ns, CAP_NET_ADMIN);
ret = !net || !ns_capable(net->user_ns, CAP_NET_ADMIN) ? -EPERM : 0;
ns_capable(inode->i_sb->s_user_ns, CAP_CHOWN))
ns_capable(inode->i_sb->s_user_ns, CAP_CHOWN))
if (ns_capable(root->mnt->mnt_sb->s_user_ns, CAP_SYS_ADMIN))
ns_capable(real_mount(root->mnt)->mnt_ns->user_ns,
if (!ns_capable(current_user_ns(), CAP_DAC_READ_SEARCH))
if (!ns_capable(sb->s_user_ns, CAP_SYS_ADMIN)) {
if (!ns_capable(current_user_ns(), CAP_SYS_CHROOT))
if (vfsuid_has_mapping(ns, vfsuid) && ns_capable(ns, CAP_FOWNER))
if (!ns_capable(sb->s_user_ns, CAP_SYS_ADMIN))
if (!ns_capable(sb->s_user_ns, CAP_SYS_ADMIN))
!ns_capable(fd_file(f)->f_cred->user_ns, CAP_DAC_READ_SEARCH))
if (!ns_capable(sb->s_user_ns, CAP_SYS_ADMIN))
return ns_capable(current->nsproxy->mnt_ns->user_ns, CAP_SYS_ADMIN);
if (flags & MNT_FORCE && !ns_capable(sb->s_user_ns, CAP_SYS_ADMIN))
if (!ns_capable(old_mnt->mnt_ns->user_ns, CAP_SYS_ADMIN))
if (!ns_capable(ns->user_ns, CAP_SYS_ADMIN))
!ns_capable(current_user_ns(), CAP_SYS_ADMIN))
if (ns_capable(sb->s_user_ns, CAP_SYS_ADMIN)) {
if (!ns_capable(fs_userns, CAP_SYS_ADMIN))
if (!ns_capable(mnt_userns, CAP_SYS_ADMIN))
if (!ns_capable(mnt_ns->user_ns, CAP_SYS_ADMIN) ||
!ns_capable(user_ns, CAP_SYS_CHROOT) ||
!ns_capable(user_ns, CAP_SYS_ADMIN))
if (!ns_capable(group->user_ns, CAP_SYS_ADMIN) &&
if (user_ns && !ns_capable(user_ns, CAP_SYS_ADMIN))
if (!ns_capable(current_user_ns(), CAP_SYS_CHROOT))
if (!ns_capable(__task_cred(p)->user_ns, CAP_SYS_NICE)) {
if (!ns_capable(__task_cred(p)->user_ns, CAP_SYS_NICE)) {
if (!ns_capable(ns, CAP_SYS_ADMIN))
if (!ns_capable(target->user_ns, CAP_SYS_ADMIN)) {
return ns_capable(fc->user_ns, CAP_SYS_ADMIN);
extern bool ns_capable(struct user_namespace *ns, int cap);
return ns_capable(ns, CAP_CHECKPOINT_RESTORE) ||
ns_capable(ns, CAP_SYS_ADMIN);
if (!ns_capable(ns->user_ns, CAP_SYS_ADMIN) ||
!ns_capable(nsset->cred->user_ns, CAP_SYS_ADMIN))
if (!ns_capable(ns->user_ns, CAP_IPC_LOCK)) {
!ns_capable(ns->user_ns, CAP_IPC_OWNER))
ns_capable(ns->user_ns, CAP_SYS_ADMIN))
return ns_capable(ns, cap) || (cap != CAP_SYS_ADMIN && ns_capable(ns, CAP_SYS_ADMIN));
if (!ns_capable(userns, CAP_BPF))
EXPORT_SYMBOL(ns_capable);
return ns_capable(&init_user_ns, cap);
return ns_capable(ns, cap) &&
if (!ns_capable(ctx->ns->user_ns, CAP_SYS_ADMIN))
if (!ns_capable(user_ns, CAP_SYS_ADMIN))
if (!ns_capable(nsset->cred->user_ns, CAP_SYS_ADMIN) ||
!ns_capable(cgroup_ns->user_ns, CAP_SYS_ADMIN))
is_capable &= ns_capable(__task_cred(task)->user_ns, CAP_KILL);
} else if (!ns_capable(user_ns, CAP_SYS_ADMIN))
if (!ns_capable(user_ns, CAP_SYS_ADMIN))
if (!ns_capable(new->user_ns, CAP_SYS_ADMIN) ||
!ns_capable(nsset->cred->user_ns, CAP_SYS_ADMIN))
if (write && !ns_capable(ns->user_ns, CAP_SYS_ADMIN))
return ns_capable(ns, CAP_SYS_PTRACE);
if (!ns_capable(pid_ns->user_ns, CAP_SYS_BOOT))
if (!ns_capable(__task_cred(p)->user_ns, CAP_SYS_NICE))
ns_capable(tcred->user_ns, CAP_KILL);
if (!ns_capable(current->nsproxy->uts_ns->user_ns, CAP_SYS_ADMIN))
if (!ns_capable(current->nsproxy->uts_ns->user_ns, CAP_SYS_ADMIN))
if (!id_match && !ns_capable(tcred->user_ns, CAP_SYS_RESOURCE))
if (ns_capable(pcred->user_ns, CAP_SYS_NICE))
if (!ns_capable(ns->user_ns, CAP_SYS_ADMIN) ||
!ns_capable(nsset->cred->user_ns, CAP_SYS_ADMIN))
if (ns_capable(ns->parent, cap_setid) &&
if (!ns_capable(user_ns, CAP_SYS_ADMIN))
if (!ns_capable(ns->user_ns, CAP_SYS_ADMIN) ||
!ns_capable(nsset->cred->user_ns, CAP_SYS_ADMIN))
if (!ns_capable(net->user_ns, CAP_NET_ADMIN))
if (!ns_capable(net->user_ns, CAP_NET_ADMIN))
if (!ns_capable(net->user_ns, CAP_NET_ADMIN))
if (!ns_capable(net->user_ns, CAP_NET_ADMIN))
if (!ns_capable(net->user_ns, CAP_NET_ADMIN))
if (!ns_capable(net->user_ns, CAP_NET_ADMIN))
if (!ns_capable(dev_net(dev)->user_ns, CAP_NET_ADMIN))
if (!ns_capable(dev_net(dev)->user_ns, CAP_NET_ADMIN))
if (!ns_capable(dev_net(dev)->user_ns, CAP_NET_ADMIN))
if (!ns_capable(dev_net(dev)->user_ns, CAP_NET_ADMIN))
if (!ns_capable(dev_net(dev)->user_ns, CAP_NET_ADMIN))
if (!ns_capable(dev_net(dev)->user_ns, CAP_NET_ADMIN))
if (!ns_capable(dev_net(dev)->user_ns, CAP_NET_ADMIN))
if (!ns_capable(dev_net(dev)->user_ns, CAP_NET_ADMIN))
if (!ns_capable(net->user_ns, CAP_NET_ADMIN))
if (!ns_capable(net->user_ns, CAP_NET_ADMIN))
if (!ns_capable(net->user_ns, CAP_NET_ADMIN)) {
if (!ns_capable(net->user_ns, CAP_NET_ADMIN))
if (!ns_capable(dev_net(br->dev)->user_ns, CAP_NET_ADMIN))
if (!ns_capable(dev_net(br->dev)->user_ns, CAP_NET_ADMIN))
if (!ns_capable(dev_net(p->dev)->user_ns, CAP_NET_ADMIN))
if (!ns_capable(net->user_ns, CAP_NET_ADMIN))
if (!ns_capable(net->user_ns, CAP_NET_ADMIN))
if (!ns_capable(net->user_ns, CAP_NET_ADMIN))
if (!ns_capable(net->user_ns, CAP_NET_ADMIN))
if (!ns_capable(net->user_ns, CAP_NET_ADMIN))
if (!ns_capable(net->user_ns, CAP_NET_ADMIN))
if (!ns_capable(net->user_ns, CAP_NET_ADMIN))
return ns_capable(net->user_ns, CAP_SYS_ADMIN);
if (!ns_capable(net->user_ns, CAP_NET_ADMIN))
if (!ns_capable(net->user_ns, CAP_SYS_ADMIN) ||
!ns_capable(nsset->cred->user_ns, CAP_SYS_ADMIN))
if (!ns_capable(net->user_ns, CAP_NET_ADMIN))
ns_capable(task_active_pid_ns(current)->user_ns, CAP_SYS_ADMIN)) &&
uid_eq(uid, cred->suid)) || ns_capable(cred->user_ns, CAP_SETUID)) &&
gid_eq(gid, cred->sgid)) || ns_capable(cred->user_ns, CAP_SETGID))) {
return has_current_bpf_ctx() || ns_capable(ns, cap);
ns_capable(user_ns, cap);
if (!ns_capable(sock_net(sk)->user_ns, CAP_NET_RAW) &&
!ns_capable(sock_net(sk)->user_ns, CAP_NET_ADMIN))
if (sk->sk_bound_dev_if && !ns_capable(net->user_ns, CAP_NET_RAW))
if (!ns_capable(sock_net(sk)->user_ns, CAP_NET_ADMIN))
if (!ns_capable(net->user_ns, CAP_NET_ADMIN))
if (!ns_capable(net->user_ns, CAP_NET_ADMIN) &&
!ns_capable(net->user_ns, CAP_NET_RAW)) {
if (!ns_capable(net->user_ns, CAP_NET_ADMIN) &&
!ns_capable(net->user_ns, CAP_NET_RAW)) {
!ns_capable(net->user_ns, CAP_NET_RAW))
!ns_capable(net->user_ns, CAP_NET_BIND_SERVICE))
if (!ns_capable(net->user_ns, CAP_NET_ADMIN))
if (!ns_capable(net->user_ns, CAP_NET_ADMIN))
if (!ns_capable(net->user_ns, CAP_NET_ADMIN))
if (write && !ns_capable(net->user_ns, CAP_NET_ADMIN))
if (!ns_capable(net->user_ns, CAP_NET_ADMIN))
if (!skb && !ns_capable(net->user_ns, CAP_NET_RAW)) {
if ((!skb && !ns_capable(net->user_ns, CAP_NET_RAW)) || opt->cipso) {
if (!skb && !ns_capable(net->user_ns, CAP_NET_RAW)) {
if (!ns_capable(net->user_ns, CAP_NET_ADMIN))
if (!ns_capable(net->user_ns, CAP_NET_ADMIN))
!ns_capable(net->user_ns, CAP_NET_ADMIN)) {
if (!ns_capable(sock_net(sk)->user_ns, CAP_NET_ADMIN))
if (!ns_capable(sock_net(sk)->user_ns, CAP_NET_ADMIN))
if (!ns_capable(sock_net(sk)->user_ns, CAP_NET_ADMIN))
if (!ns_capable(sock_net(sk)->user_ns, CAP_NET_ADMIN))
if (!ns_capable(net->user_ns, CAP_NET_ADMIN))
if (!ns_capable(net->user_ns, CAP_NET_ADMIN))
!ns_capable(net->user_ns, CAP_NET_RAW))
!ns_capable(net->user_ns, CAP_NET_BIND_SERVICE))
if (!ns_capable(net->user_ns, CAP_NET_ADMIN))
if (!ns_capable(net->user_ns, CAP_NET_RAW)) {
if (!ns_capable(net->user_ns, CAP_NET_RAW)) {
if (!ns_capable(net->user_ns, CAP_NET_RAW)) {
ns_capable(net->user_ns, CAP_NET_ADMIN)) {
if (!ns_capable(net->user_ns, CAP_NET_ADMIN))
if (!ns_capable(net->user_ns, CAP_NET_ADMIN))
if (!ns_capable(net->user_ns, CAP_NET_ADMIN))
if (!ns_capable(net->user_ns, CAP_NET_ADMIN))
if (!ns_capable(net->user_ns, CAP_NET_ADMIN))
if (!ns_capable(net->user_ns, CAP_NET_ADMIN))
!ns_capable(net->user_ns, CAP_NET_ADMIN))
if (!ns_capable(sock_net(sk)->user_ns, CAP_NET_ADMIN))
if (!ns_capable(sock_net(sk)->user_ns, CAP_NET_ADMIN))
if (!ns_capable(net->user_ns, CAP_NET_ADMIN))
if (!ns_capable(t->net->user_ns, CAP_NET_ADMIN))
if (!ns_capable(net->user_ns, CAP_NET_ADMIN))
if (!ns_capable(t->net->user_ns, CAP_NET_ADMIN))
if (!ns_capable(t->net->user_ns, CAP_NET_ADMIN))
if (!ns_capable(net->user_ns, CAP_NET_ADMIN))
if (!ns_capable(net->user_ns, CAP_NET_RAW))
cap_net_admin = ns_capable(sock_net(sk)->user_ns, CAP_NET_ADMIN);
if (!ns_capable(net->user_ns, CAP_NET_ADMIN))
if (!ns_capable(sock_net(sk)->user_ns, CAP_NET_ADMIN))
if (!ns_capable(sock_net(sk)->user_ns, CAP_NET_ADMIN))
if (!ns_capable(sock_net(sk)->user_ns, CAP_NET_BROADCAST))
ns_capable(user_ns, cap);
ns_capable(sock_net(sock->sk)->user_ns, CAP_NET_ADMIN);
!ns_capable(net->user_ns, CAP_NET_ADMIN))
!ns_capable(net->user_ns, CAP_SYS_ADMIN))
if (!ns_capable(net->user_ns, CAP_NET_RAW))
if (!ns_capable(net->user_ns, CAP_NET_RAW))
!ns_capable(net->user_ns, CAP_NET_BIND_SERVICE))
!ns_capable(net->user_ns, CAP_NET_BIND_SERVICE))
if (!ns_capable(net->user_ns, CAP_NET_ADMIN))
if (!ns_capable(sock_net(sk)->user_ns, CAP_NET_ADMIN))
if (!ns_capable(net->user_ns, CAP_NET_RAW))
if (!ns_capable(user_ns, CAP_SYS_ADMIN))
if (!ns_capable(user_ns, CAP_SYS_ADMIN))
if (!is_subset && !ns_capable(__task_cred(p)->user_ns, CAP_SYS_NICE))
if (!ns_capable(current_user_ns(), CAP_SETPCAP))
if (ns_capable(child_cred->user_ns, CAP_SYS_PTRACE))
if (ns_capable(inode->i_sb->s_user_ns, CAP_SETFCAP))
if (!ns_capable(new->user_ns, CAP_SETUID) ||
!ns_capable(ns, CAP_SETUID))
!ns_capable(__task_cred(child)->user_ns, CAP_SYS_PTRACE))
if (!ns_capable(__task_cred(child)->user_ns, CAP_SYS_PTRACE))