Home
last modified time | relevance | path

Searched refs:ucounts (Results 1 – 25 of 39) sorted by relevance

12

/Linux-v5.15/kernel/
Ducount.c11 struct ucounts init_ucounts = {
134 static struct ucounts *find_ucounts(struct user_namespace *ns, kuid_t uid, struct hlist_head *hashe… in find_ucounts()
136 struct ucounts *ucounts; in find_ucounts() local
138 hlist_for_each_entry(ucounts, hashent, node) { in find_ucounts()
139 if (uid_eq(ucounts->uid, uid) && (ucounts->ns == ns)) in find_ucounts()
140 return ucounts; in find_ucounts()
145 static void hlist_add_ucounts(struct ucounts *ucounts) in hlist_add_ucounts() argument
147 struct hlist_head *hashent = ucounts_hashentry(ucounts->ns, ucounts->uid); in hlist_add_ucounts()
149 hlist_add_head(&ucounts->node, hashent); in hlist_add_ucounts()
153 struct ucounts *get_ucounts(struct ucounts *ucounts) in get_ucounts() argument
[all …]
Dutsname.c20 static struct ucounts *inc_uts_namespaces(struct user_namespace *ns) in inc_uts_namespaces()
25 static void dec_uts_namespaces(struct ucounts *ucounts) in dec_uts_namespaces() argument
27 dec_ucount(ucounts, UCOUNT_UTS_NAMESPACES); in dec_uts_namespaces()
49 struct ucounts *ucounts; in clone_uts_ns() local
53 ucounts = inc_uts_namespaces(user_ns); in clone_uts_ns()
54 if (!ucounts) in clone_uts_ns()
66 ns->ucounts = ucounts; in clone_uts_ns()
78 dec_uts_namespaces(ucounts); in clone_uts_ns()
108 dec_uts_namespaces(ns->ucounts); in free_uts_ns()
Dpid_namespace.c61 static struct ucounts *inc_pid_namespaces(struct user_namespace *ns) in inc_pid_namespaces()
66 static void dec_pid_namespaces(struct ucounts *ucounts) in dec_pid_namespaces() argument
68 dec_ucount(ucounts, UCOUNT_PID_NAMESPACES); in dec_pid_namespaces()
76 struct ucounts *ucounts; in create_pid_namespace() local
86 ucounts = inc_pid_namespaces(user_ns); in create_pid_namespace()
87 if (!ucounts) in create_pid_namespace()
110 ns->ucounts = ucounts; in create_pid_namespace()
119 dec_pid_namespaces(ucounts); in create_pid_namespace()
128 dec_pid_namespaces(ns->ucounts); in delayed_free_pidns()
Dcred.c63 .ucounts = &init_ucounts,
123 if (cred->ucounts) in put_cred_rcu()
124 put_ucounts(cred->ucounts); in put_cred_rcu()
287 new->ucounts = get_ucounts(new->ucounts); in prepare_creds()
288 if (!new->ucounts) in prepare_creds()
499 inc_rlimit_ucounts(new->ucounts, UCOUNT_RLIMIT_NPROC, 1); in commit_creds()
503 dec_rlimit_ucounts(old->ucounts, UCOUNT_RLIMIT_NPROC, 1); in commit_creds()
670 struct ucounts *new_ucounts, *old_ucounts = new->ucounts; in set_cred_ucounts()
685 new->ucounts = new_ucounts; in set_cred_ucounts()
755 new->ucounts = get_ucounts(new->ucounts); in prepare_kernel_cred()
[all …]
Duser_namespace.c32 static struct ucounts *inc_user_namespaces(struct user_namespace *ns, kuid_t uid) in inc_user_namespaces()
37 static void dec_user_namespaces(struct ucounts *ucounts) in dec_user_namespaces() argument
39 return dec_ucount(ucounts, UCOUNT_USER_NAMESPACES); in dec_user_namespaces()
74 struct ucounts *ucounts; in create_user_ns() local
81 ucounts = inc_user_namespaces(parent_ns, owner); in create_user_ns()
82 if (!ucounts) in create_user_ns()
129 ns->ucounts = ucounts; in create_user_ns()
154 dec_user_namespaces(ucounts); in create_user_ns()
185 struct ucounts *ucounts = ns->ucounts; in free_user_ns() local
203 dec_user_namespaces(ucounts); in free_user_ns()
/Linux-v5.15/include/linux/
Duser_namespace.h38 struct ucounts;
100 struct ucounts *ucounts; member
104 struct ucounts { struct
113 extern struct ucounts init_ucounts; argument
117 struct ucounts *inc_ucount(struct user_namespace *ns, kuid_t uid, enum ucount_type type);
118 void dec_ucount(struct ucounts *ucounts, enum ucount_type type);
119 struct ucounts *alloc_ucounts(struct user_namespace *ns, kuid_t uid);
120 struct ucounts * __must_check get_ucounts(struct ucounts *ucounts);
121 void put_ucounts(struct ucounts *ucounts);
123 static inline long get_ucounts_value(struct ucounts *ucounts, enum ucount_type type) in get_ucounts_value() argument
[all …]
Dsignal_types.h16 struct ucounts;
26 struct ucounts *ucounts; member
Dutsname.h26 struct ucounts *ucounts; member
Dpid_namespace.h31 struct ucounts *ucounts; member
Dcred.h146 struct ucounts *ucounts; member
374 #define task_ucounts(task) (task_cred_xxx((task), ucounts))
391 #define current_ucounts() (current_cred_xxx(ucounts))
Dipc_namespace.h68 struct ucounts *ucounts; member
Dfsnotify_backend.h228 struct ucounts *ucounts; member
240 struct ucounts *ucounts; member
Dtime_namespace.h21 struct ucounts *ucounts; member
Dshmem_fs.h69 extern int shmem_lock(struct file *file, int lock, struct ucounts *ucounts);
/Linux-v5.15/fs/notify/inotify/
Dinotify.h36 static inline void dec_inotify_instances(struct ucounts *ucounts) in dec_inotify_instances() argument
38 dec_ucount(ucounts, UCOUNT_INOTIFY_INSTANCES); in dec_inotify_instances()
41 static inline struct ucounts *inc_inotify_watches(struct ucounts *ucounts) in inc_inotify_watches() argument
43 return inc_ucount(ucounts->ns, ucounts->uid, UCOUNT_INOTIFY_WATCHES); in inc_inotify_watches()
46 static inline void dec_inotify_watches(struct ucounts *ucounts) in dec_inotify_watches() argument
48 dec_ucount(ucounts, UCOUNT_INOTIFY_WATCHES); in dec_inotify_watches()
Dinotify_fsnotify.c176 if (group->inotify_data.ucounts) in inotify_free_group_priv()
177 dec_inotify_instances(group->inotify_data.ucounts); in inotify_free_group_priv()
/Linux-v5.15/kernel/cgroup/
Dnamespace.c12 static struct ucounts *inc_cgroup_namespaces(struct user_namespace *ns) in inc_cgroup_namespaces()
17 static void dec_cgroup_namespaces(struct ucounts *ucounts) in dec_cgroup_namespaces() argument
19 dec_ucount(ucounts, UCOUNT_CGROUP_NAMESPACES); in dec_cgroup_namespaces()
43 dec_cgroup_namespaces(ns->ucounts); in free_cgroup_ns()
55 struct ucounts *ucounts; in copy_cgroup_ns() local
69 ucounts = inc_cgroup_namespaces(user_ns); in copy_cgroup_ns()
70 if (!ucounts) in copy_cgroup_ns()
82 dec_cgroup_namespaces(ucounts); in copy_cgroup_ns()
87 new_ns->ucounts = ucounts; in copy_cgroup_ns()
/Linux-v5.15/ipc/
Dnamespace.c22 static struct ucounts *inc_ipc_namespaces(struct user_namespace *ns) in inc_ipc_namespaces()
27 static void dec_ipc_namespaces(struct ucounts *ucounts) in dec_ipc_namespaces() argument
29 dec_ucount(ucounts, UCOUNT_IPC_NAMESPACES); in dec_ipc_namespaces()
36 struct ucounts *ucounts; in create_ipc_ns() local
40 ucounts = inc_ipc_namespaces(user_ns); in create_ipc_ns()
41 if (!ucounts) in create_ipc_ns()
56 ns->ucounts = ucounts; in create_ipc_ns()
74 dec_ipc_namespaces(ucounts); in create_ipc_ns()
128 dec_ipc_namespaces(ns->ucounts); in free_ipc_ns()
Dmqueue.c147 struct ucounts *ucounts; /* user who created, for accounting */ member
323 info->ucounts = NULL; /* set when all is ok */ in mqueue_get_inode()
373 info->ucounts = get_ucounts(current_ucounts()); in mqueue_get_inode()
374 if (info->ucounts) { in mqueue_get_inode()
378 msgqueue = inc_rlimit_ucounts(info->ucounts, UCOUNT_RLIMIT_MSGQUEUE, mq_bytes); in mqueue_get_inode()
380 dec_rlimit_ucounts(info->ucounts, UCOUNT_RLIMIT_MSGQUEUE, mq_bytes); in mqueue_get_inode()
382 put_ucounts(info->ucounts); in mqueue_get_inode()
383 info->ucounts = NULL; in mqueue_get_inode()
525 if (info->ucounts) { in mqueue_evict_inode()
537 dec_rlimit_ucounts(info->ucounts, UCOUNT_RLIMIT_MSGQUEUE, mq_bytes); in mqueue_evict_inode()
[all …]
/Linux-v5.15/kernel/time/
Dnamespace.c59 static struct ucounts *inc_time_namespaces(struct user_namespace *ns) in inc_time_namespaces()
64 static void dec_time_namespaces(struct ucounts *ucounts) in dec_time_namespaces() argument
66 dec_ucount(ucounts, UCOUNT_TIME_NAMESPACES); in dec_time_namespaces()
82 struct ucounts *ucounts; in clone_time_ns() local
86 ucounts = inc_time_namespaces(user_ns); in clone_time_ns()
87 if (!ucounts) in clone_time_ns()
105 ns->ucounts = ucounts; in clone_time_ns()
117 dec_time_namespaces(ucounts); in clone_time_ns()
231 dec_time_namespaces(ns->ucounts); in free_time_ns()
/Linux-v5.15/mm/
Dmlock.c821 int user_shm_lock(size_t size, struct ucounts *ucounts) in user_shm_lock() argument
833 memlock = inc_rlimit_ucounts(ucounts, UCOUNT_RLIMIT_MEMLOCK, locked); in user_shm_lock()
836 dec_rlimit_ucounts(ucounts, UCOUNT_RLIMIT_MEMLOCK, locked); in user_shm_lock()
839 if (!get_ucounts(ucounts)) { in user_shm_lock()
840 dec_rlimit_ucounts(ucounts, UCOUNT_RLIMIT_MEMLOCK, locked); in user_shm_lock()
849 void user_shm_unlock(size_t size, struct ucounts *ucounts) in user_shm_unlock() argument
852 dec_rlimit_ucounts(ucounts, UCOUNT_RLIMIT_MEMLOCK, (size + PAGE_SIZE - 1) >> PAGE_SHIFT); in user_shm_unlock()
854 put_ucounts(ucounts); in user_shm_unlock()
Dmemfd.c300 struct ucounts *ucounts = NULL; in SYSCALL_DEFINE2() local
302 file = hugetlb_file_setup(name, 0, VM_NORESERVE, &ucounts, in SYSCALL_DEFINE2()
/Linux-v5.15/net/core/
Dnet_namespace.c380 static struct ucounts *inc_net_namespaces(struct user_namespace *ns) in inc_net_namespaces()
385 static void dec_net_namespaces(struct ucounts *ucounts) in dec_net_namespaces() argument
387 dec_ucount(ucounts, UCOUNT_NET_NAMESPACES); in dec_net_namespaces()
446 struct ucounts *ucounts; in copy_net_ns() local
453 ucounts = inc_net_namespaces(user_ns); in copy_net_ns()
454 if (!ucounts) in copy_net_ns()
463 net->ucounts = ucounts; in copy_net_ns()
480 dec_net_namespaces(ucounts); in copy_net_ns()
607 dec_net_namespaces(net->ucounts); in cleanup_net()
/Linux-v5.15/fs/
Dmount.h19 struct ucounts *ucounts; member
/Linux-v5.15/fs/hugetlbfs/
Dinode.c1449 vm_flags_t acctflag, struct ucounts **ucounts, in hugetlb_file_setup() argument
1461 *ucounts = NULL; in hugetlb_file_setup()
1467 *ucounts = current_ucounts(); in hugetlb_file_setup()
1468 if (user_shm_lock(size, *ucounts)) { in hugetlb_file_setup()
1474 *ucounts = NULL; in hugetlb_file_setup()
1501 if (*ucounts) { in hugetlb_file_setup()
1502 user_shm_unlock(size, *ucounts); in hugetlb_file_setup()
1503 *ucounts = NULL; in hugetlb_file_setup()

12