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
67 67
68 initial_sid_to_string_len = sizeof(initial_sid_to_string) / sizeof (char *);68 initial_sid_to_string_len = sizeof(initial_sid_to_string) / sizeof (char *);
69 /* print out the sids */69 /* print out the sids */
70 for (i = 1; i < initial_sid_to_string_len; i++)70 for (i = 1; i < initial_sid_to_string_len; i++) {
71 fprintf(fout, "sid %s\n", initial_sid_to_string[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 }
72 fprintf(fout, "\n");78 fprintf(fout, "\n");
73 79
74 /* print out the class permissions */80 /* print out the class permissions */
@@ -126,9 +132,16 @@ int main(int argc, char *argv[]) · 51 unmodified lines
126#define OBJUSERROLETYPE "user_u:object_r:base_t"132#define OBJUSERROLETYPE "user_u:object_r:base_t"
127 133
128 /* default sids */134 /* default sids */
129 for (i = 1; i < initial_sid_to_string_len; i++)135 for (i = 1; i < initial_sid_to_string_len; i++) {
130 fprintf(fout, "sid %s " SUBJUSERROLETYPE "%s\n",136 const char *name = initial_sid_to_string[i];
131 initial_sid_to_string[i], mls ? ":" SYSTEMLOW : "");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 }
132 fprintf(fout, "\n");145 fprintf(fout, "\n");
133 146
134#define FS_USE(behavior, fstype) \147#define FS_USE(behavior, fstype) \