services.c (a9029d97045468bc25281971d452b6cecf009553) services.c (ded34574d4d351ab0ca095a45496b393cef611c2)
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Implementation of the security services.
4 *
5 * Authors : Stephen Smalley, <sds@tycho.nsa.gov>
6 * James Morris <jmorris@redhat.com>
7 *
8 * Updated: Trusted Computer Solutions, Inc. <dgoeddel@trustedcs.com>

--- 85 unchanged lines hidden (view full) ---

94static void context_struct_compute_av(struct policydb *policydb,
95 struct context *scontext,
96 struct context *tcontext,
97 u16 tclass,
98 struct av_decision *avd,
99 struct extended_perms *xperms);
100
101static int selinux_set_mapping(struct policydb *pol,
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Implementation of the security services.
4 *
5 * Authors : Stephen Smalley, <sds@tycho.nsa.gov>
6 * James Morris <jmorris@redhat.com>
7 *
8 * Updated: Trusted Computer Solutions, Inc. <dgoeddel@trustedcs.com>

--- 85 unchanged lines hidden (view full) ---

94static void context_struct_compute_av(struct policydb *policydb,
95 struct context *scontext,
96 struct context *tcontext,
97 u16 tclass,
98 struct av_decision *avd,
99 struct extended_perms *xperms);
100
101static int selinux_set_mapping(struct policydb *pol,
102 struct security_class_mapping *map,
102 const struct security_class_mapping *map,
103 struct selinux_map *out_map)
104{
105 u16 i, j;
106 unsigned k;
107 bool print_unknown_handle = false;
108
109 /* Find number of classes in the input mapping */
110 if (!map)

--- 5 unchanged lines hidden (view full) ---

116 /* Allocate space for the class records, plus one for class zero */
117 out_map->mapping = kcalloc(++i, sizeof(*out_map->mapping), GFP_ATOMIC);
118 if (!out_map->mapping)
119 return -ENOMEM;
120
121 /* Store the raw class and permission values */
122 j = 0;
123 while (map[j].name) {
103 struct selinux_map *out_map)
104{
105 u16 i, j;
106 unsigned k;
107 bool print_unknown_handle = false;
108
109 /* Find number of classes in the input mapping */
110 if (!map)

--- 5 unchanged lines hidden (view full) ---

116 /* Allocate space for the class records, plus one for class zero */
117 out_map->mapping = kcalloc(++i, sizeof(*out_map->mapping), GFP_ATOMIC);
118 if (!out_map->mapping)
119 return -ENOMEM;
120
121 /* Store the raw class and permission values */
122 j = 0;
123 while (map[j].name) {
124 struct security_class_mapping *p_in = map + (j++);
124 const struct security_class_mapping *p_in = map + (j++);
125 struct selinux_mapping *p_out = out_map->mapping + j;
126
127 /* An empty class string skips ahead */
128 if (!strcmp(p_in->name, "")) {
129 p_out->num_perms = 0;
130 continue;
131 }
132

--- 3932 unchanged lines hidden ---
125 struct selinux_mapping *p_out = out_map->mapping + j;
126
127 /* An empty class string skips ahead */
128 if (!strcmp(p_in->name, "")) {
129 p_out->num_perms = 0;
130 continue;
131 }
132

--- 3932 unchanged lines hidden ---