SELinux: validate kernel object classes and permissions
A message that is not in the archive (sent off-list or not yet received): C1751E53.19473%[email protected]
(re-added list to cc)
Quoted 18 lines · Chad Sellers
Quoted 9 lines · Stephen Smalley
Quoted 8 lines · Chad Sellers
Index:
linux-2.6-discovery/security/selinux/ss/services.c
===================================================================security/selinux/ss/services.c +0
-0@@ -53,6 +57,11 @@extern void selnl_notify_policyload (u32 seqno);unsigned int policydb_loaded_version;Quoted 7 lines
security/selinux/ss/services.c line 63
Quoted 4 lines
security/selinux/ss/services.c +4
-0+/* +* This is declared in avc.c +*/ +extern const struct selinux_class_perm selinux_class_perm;(nit) Belongs in
avc_ss.h.
Quoted 4 lines
OK, I guess that makes sense. Just seems weird since the struct is actually in
avc.c, andavc.cincludesavc_ss.h. I'll resend with that change if I end up needing to resend for other reasons. Is this a big enough deal to resend if not?
No.
Quoted 29 lines
Quoted 1 line
What test cases have you applied?
I've tested the following policies:
base case - minimal policy that should work fine
extra class - add an extra class on the end, which should load extra perm - add an extra perm to a class, which should load missing class - remove a class from the end, simulating a kernel with a new class that isn't in policy yes, which should load
missing perm - remove a perm from the end of a class, which should load wrong class - class with wrong value, which should fail
wrong perm - perm with wrong value, which should fail
change class - load 2 policies back to back, each with extra classes. Change the values of those classes between reloads. Simulates semanage linking a new class and changing the value of an old class, which should load change perm - same as change class but with perms
wrong common - switch the inherits for a class, which should fail missing common - delete the inheritance from a class (adding the same number of perms at the beginning of the class), which should fail
bad common - common with an incorrect perm, which should fail extra common - add a common to a class that didn't have one, which should fail
missing common perm - remove common perm from the end, also ensuring that any class inheriting it does not have perms as the offsets will be off, which should loadLet me know if those descriptions don't make sense. I can send the policies if you'd rather.
Thanks,
Chad
Signature · 8 lines
Stephen Smalley National Security Agency -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 1 line · Stephen Smalley
(re-added list to cc)
Thanks.
Stephen, do you think these patches are suitable for merging?
- James
Signature · 7 lines
James Morris <[email protected]> -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Stephen Smalley
Acked-byQuoted 7 lines · James Morris
Quoted 1 line · Stephen Smalley
(re-added list to cc)
Thanks.
Stephen, do you think these patches are suitable for merging?
Yes.
We should also follow up with a patch that strips the non-kernel classes and permissions from the kernel headers (possibly by modifying the script in policy to emit two sets of headers, one for kernel and one for libselinux, based on the already existing # userspace annotations in security_classes).
Signature · 8 lines
Stephen Smalley National Security Agency -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 5 lines · Stephen Smalley
Quoted 4 lines · James Morris
Quoted 1 line · Stephen Smalley
(re-added list to cc)
Quoted 7 lines
Quoted 3 lines
Thanks.
Stephen, do you think these patches are suitable for merging?
Yes.
Acked-by Stephen Smalley <[email protected]>
Applied togit://git.kernel.org/pub/scm/linux/kernel/git/jmorris/selinux-2.6.20.git
Signature · 7 lines
James Morris <[email protected]> -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.