selinux: declare data arrays const
authorChristian Göttsche <cgzones@googlemail.com>
Mon, 2 May 2022 14:43:38 +0000 (16:43 +0200)
committerPaul Moore <paul@paul-moore.com>
Tue, 3 May 2022 19:53:49 +0000 (15:53 -0400)
commitded34574d4d351ab0ca095a45496b393cef611c2
tree6884a97c4ba2c10ad542db83cfbd8afeab326895
parenta9029d97045468bc25281971d452b6cecf009553
selinux: declare data arrays const

The arrays for the policy capability names, the initial sid identifiers
and the class and permission names are not changed at runtime.  Declare
them const to avoid accidental modification.

Do not override the classmap and the initial sid list in the build time
script genheaders.

Check flose(3) is successful in genheaders.c, otherwise the written data
might be corrupted or incomplete.

Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
[PM: manual merge due to fuzz, minor style tweaks]
Signed-off-by: Paul Moore <paul@paul-moore.com>
scripts/selinux/genheaders/genheaders.c
scripts/selinux/mdp/mdp.c
security/selinux/avc.c
security/selinux/include/avc_ss.h
security/selinux/include/classmap.h
security/selinux/include/initial_sid_to_string.h
security/selinux/include/policycap.h
security/selinux/include/policycap_names.h
security/selinux/ss/avtab.c
security/selinux/ss/policydb.c
security/selinux/ss/services.c