Lines Matching defs:resource
5 * This file contains AppArmor resource mediation and attachment
16 #include "include/resource.h"
20 * Table of rlimit names: we generate it from resource.h.
29 /* audit callback for resource specific fields */
44 * audit_resource - audit setting resource limit
46 * @resource: rlimit being auditing
52 static int audit_resource(struct aa_profile *profile, unsigned int resource,
58 aad(&sa)->rlim.rlim = resource;
68 * aa_map_resouce - map compiled policy resource to internal #
69 * @resource: flattened policy resource number
71 * Returns: resource # for the current architecture.
73 * rlimit resource can vary based on architecture, map the compiled policy
74 * resource # to the internal representation for the architecture.
76 int aa_map_resource(int resource)
78 return rlim_map[resource];
81 static int profile_setrlimit(struct aa_profile *profile, unsigned int resource,
86 if (profile->rlimits.mask & (1 << resource) && new_rlim->rlim_max >
87 profile->rlimits.limits[resource].rlim_max)
89 return audit_resource(profile, resource, new_rlim->rlim_max, NULL, 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)
102 * Returns: 0 or error code if setting resource failed
105 unsigned int resource, struct rlimit *new_rlim)
115 /* TODO: extend resource control to handle other (non current)
117 * that the task is setting the resource of a task confined with
118 * the same profile or that the task setting the resource of another
125 audit_resource(profile, resource,
130 profile_setrlimit(profile, resource, new_rlim));