History

Merge tag 'selinux-pr-20200803' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux

Pull selinux updates from Paul Moore: "Beyond the usual smattering of bug fixes, we've got three small improvements worth highlighting: - improved SELinux policy symbol table performance due to a reworking of the insert and search functions - allow reading of SELinux labels before the policy is loaded, allowing for some more "exotic" initramfs approaches - improved checking an error reporting about process class/permissions during SELinux policy load" * tag 'selinux-pr-20200803' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux: selinux: complete the inlining of hashtab functions selinux: prepare for inlining of hashtab functions selinux: specialize symtab insert and search functions selinux: Fix spelling mistakes in the comments selinux: fixed a checkpatch warning with the sizeof macro selinux: log error messages on required process class / permissions scripts/selinux/mdp: fix initial SID handling selinux: allow reading labels before policy is loaded

Linus Torvalds committed 6 years ago

Commit 49e917d2 parents 9ecc6ea 54b27f915 files · +258 −166Browse files

Showing the changes to scripts (1 of 15 files). Show all

Unified · Split

scripts/selinux/mdp/mdp.c+18−5
@@ -67,8 +67,14 @@ int main(int argc, char *argv[]) · 66 unmodified lines
6767
6868 initial_sid_to_string_len = sizeof(initial_sid_to_string) / sizeof (char *);
6969 /* print out the sids */
70− for (i = 1; i < initial_sid_to_string_len; i++)
71− fprintf(fout, "sid %s\n", initial_sid_to_string[i]);
70+ for (i = 1; i < initial_sid_to_string_len; i++) {
71+ const char *name = initial_sid_to_string[i];
72+
73+ if (name)
74+ fprintf(fout, "sid %s\n", name);
75+ else
76+ fprintf(fout, "sid unused%d\n", i);
77+ }
7278 fprintf(fout, "\n");
7379
7480 /* print out the class permissions */
@@ -126,9 +132,16 @@ int main(int argc, char *argv[]) · 51 unmodified lines
126132 #define OBJUSERROLETYPE "user_u:object_r:base_t"
127133
128134 /* default sids */
129− for (i = 1; i < initial_sid_to_string_len; i++)
130− fprintf(fout, "sid %s " SUBJUSERROLETYPE "%s\n",
131− initial_sid_to_string[i], mls ? ":" SYSTEMLOW : "");
135+ for (i = 1; i < initial_sid_to_string_len; i++) {
136+ const char *name = initial_sid_to_string[i];
137+
138+ if (name)
139+ fprintf(fout, "sid %s ", name);
140+ else
141+ fprintf(fout, "sid unused%d\n", i);
142+ fprintf(fout, SUBJUSERROLETYPE "%s\n",
143+ mls ? ":" SYSTEMLOW : "");
144+ }
132145 fprintf(fout, "\n");
133146
134147 #define FS_USE(behavior, fstype) \