Lines Matching +full:current +full:- +full:limit

1 // SPDX-License-Identifier: GPL-2.0-only
7 * Copyright (C) 1998-2008 Novell/SUSE
8 * Copyright 2009-2010 Canonical Ltd.
35 rlim_names[aad(sa)->rlim.rlim], aad(sa)->rlim.max); in audit_cb()
36 if (aad(sa)->peer) { in audit_cb()
38 aa_label_xaudit(ab, labels_ns(aad(sa)->label), aad(sa)->peer, in audit_cb()
44 * audit_resource - audit setting resource limit
50 * Returns: 0 or sa->error else other error code on failure
58 aad(&sa)->rlim.rlim = resource; in audit_resource()
59 aad(&sa)->rlim.max = value; in audit_resource()
60 aad(&sa)->peer = peer; in audit_resource()
61 aad(&sa)->info = info; in audit_resource()
62 aad(&sa)->error = error; in audit_resource()
68 * aa_map_resouce - map compiled policy resource to internal #
71 * Returns: resource # for the current architecture.
86 if (profile->rlimits.mask & (1 << resource) && new_rlim->rlim_max > in profile_setrlimit()
87 profile->rlimits.limits[resource].rlim_max) in profile_setrlimit()
88 e = -EACCES; in profile_setrlimit()
89 return audit_resource(profile, resource, new_rlim->rlim_max, NULL, NULL, in profile_setrlimit()
94 * aa_task_setrlimit - test permission to set an rlimit
95 * @label - label confining the task (NOT NULL)
96 * @task - task the resource is being set on
97 * @resource - the resource being set
98 * @new_rlim - the new resource limit (NOT NULL)
100 * Control raising the processes hard limit.
115 /* TODO: extend resource control to handle other (non current) in aa_task_setrlimit()
126 new_rlim->rlim_max, peer, in aa_task_setrlimit()
127 "cap_sys_resource", -EACCES)); in aa_task_setrlimit()
137 * __aa_transition_rlimits - apply new profile rlimits
151 /* for any rlimits the profile controlled, reset the soft limit in __aa_transition_rlimits()
152 * to the lesser of the tasks hard limit and the init tasks soft limit in __aa_transition_rlimits()
155 if (old->rlimits.mask) { in __aa_transition_rlimits()
160 if (old->rlimits.mask & mask) { in __aa_transition_rlimits()
161 rlim = current->signal->rlim + j; in __aa_transition_rlimits()
162 initrlim = init_task.signal->rlim + j; in __aa_transition_rlimits()
163 rlim->rlim_cur = min(rlim->rlim_max, in __aa_transition_rlimits()
164 initrlim->rlim_cur); in __aa_transition_rlimits()
174 if (!new->rlimits.mask) in __aa_transition_rlimits()
177 if (!(new->rlimits.mask & mask)) in __aa_transition_rlimits()
180 rlim = current->signal->rlim + j; in __aa_transition_rlimits()
181 rlim->rlim_max = min(rlim->rlim_max, in __aa_transition_rlimits()
182 new->rlimits.limits[j].rlim_max); in __aa_transition_rlimits()
183 /* soft limit should not exceed hard limit */ in __aa_transition_rlimits()
184 rlim->rlim_cur = min(rlim->rlim_cur, rlim->rlim_max); in __aa_transition_rlimits()