]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit6499d006206f86c9df94f5d3552b21a093dfd437
tree6884a97c4ba2c10ad542db83cfbd8afeab326895
parent34ccdff0340cdd3fd260b25038c358ee27feb8ca
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