aboutsummaryrefslogtreecommitdiff
path: root/scripts/selinux/genheaders/genheaders.c
diff options
context:
space:
mode:
authorMark Brown <[email protected]>2017-09-19 14:12:47 +0100
committerMark Brown <[email protected]>2017-09-19 14:12:47 +0100
commite9331ee9b164d58b4dd0abc882ba7e23d2f404b3 (patch)
tree903d078e53a59ed65708193f2486ad0b9a8109d8 /scripts/selinux/genheaders/genheaders.c
parente7251484f3bc3bd9203a2c39555ca7d53e988cf6 (diff)
parent2bd6bf03f4c1c59381d62c61d03f6cc3fe71f66e (diff)
Merge tag 'v4.14-rc1' into asoc-rockchip
Linux 4.14-rc1
Diffstat (limited to 'scripts/selinux/genheaders/genheaders.c')
-rw-r--r--scripts/selinux/genheaders/genheaders.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/selinux/genheaders/genheaders.c b/scripts/selinux/genheaders/genheaders.c
index 6a24569c3578..672b069dcfea 100644
--- a/scripts/selinux/genheaders/genheaders.c
+++ b/scripts/selinux/genheaders/genheaders.c
@@ -129,11 +129,16 @@ int main(int argc, char *argv[])
for (i = 0; secclass_map[i].name; i++) {
struct security_class_mapping *map = &secclass_map[i];
for (j = 0; map->perms[j]; j++) {
+ if (j >= 32) {
+ fprintf(stderr, "Too many permissions to fit into an access vector at (%s, %s).\n",
+ map->name, map->perms[j]);
+ exit(5);
+ }
fprintf(fout, "#define %s__%s", map->name,
map->perms[j]);
for (k = 0; k < max(1, 40 - strlen(map->name) - strlen(map->perms[j])); k++)
fprintf(fout, " ");
- fprintf(fout, "0x%08xUL\n", (1<<j));
+ fprintf(fout, "0x%08xU\n", (1<<j));
}
}