mirror of
https://github.com/torvalds/linux.git
synced 2024-11-26 22:21:42 +00:00
selinux: update type for number of class permissions in services code
Security classes have only up to 32 permissions, hence using an u16 is sufficient (while improving padding in struct selinux_mapping). Signed-off-by: Christian Göttsche <cgzones@googlemail.com> Signed-off-by: Paul Moore <paul@paul-moore.com>
This commit is contained in:
parent
df9d474925
commit
002903e1d1
@ -97,7 +97,6 @@ static int selinux_set_mapping(struct policydb *pol,
|
||||
struct selinux_map *out_map)
|
||||
{
|
||||
u16 i, j;
|
||||
unsigned k;
|
||||
bool print_unknown_handle = false;
|
||||
|
||||
/* Find number of classes in the input mapping */
|
||||
@ -117,6 +116,7 @@ static int selinux_set_mapping(struct policydb *pol,
|
||||
while (map[j].name) {
|
||||
const struct security_class_mapping *p_in = map + (j++);
|
||||
struct selinux_mapping *p_out = out_map->mapping + j;
|
||||
u16 k;
|
||||
|
||||
/* An empty class string skips ahead */
|
||||
if (!strcmp(p_in->name, "")) {
|
||||
|
@ -12,7 +12,7 @@
|
||||
/* Mapping for a single class */
|
||||
struct selinux_mapping {
|
||||
u16 value; /* policy value for class */
|
||||
unsigned int num_perms; /* number of permissions in class */
|
||||
u16 num_perms; /* number of permissions in class */
|
||||
u32 perms[sizeof(u32) * 8]; /* policy values for permissions */
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user