sepol, write.c policy version
PATCH 1/1 sepol, write.c policy version
Make version comparisons correctly compare kernel policies with kernel versions and module policies with module versions.
Joshua Brindle
src/write.c +2 -2
@@ -51,11 +51,11 @@ static int avrule_write_list(avrule_t *aint sepol_set_policyvers (unsigned int type,unsigned int version) { -if (type ==POLICY_KERN || type ==POLICY_BASE ) { +if (type ==POLICY_KERN ) {if (version <POLICYDB_VERSION_MIN || version >POLICYDB_VERSION_MAX )return -EINVAL ; } -else if (type ==POLICY_MOD ) { +else if (type ==POLICY_BASE || type ==POLICY_MOD ) {if (version <MOD_POLICYDB_VERSION_MIN || version >MOD_POLICYDB_VERSION_MAX ) {return -EINVAL ;
Quoted 2 lines · Joshua Brindle
Make version comparisons correctly compare kernel policies with kernel versions and module policies with module versions.
Ok, entire patch set merged except for the one diff in patch 7.
With this change, the base module now uses the module version numbers instead of the kernel policy version numbers. What does this mean for other cases where the policy version is checked, e.g.:
MLS check in context_write/read
validatetrans check in class_write/read
MLS check in user_write/read
MLS check in policydb_write/read for call to range_write/read
Should the MLS/validatetrans elements be unconditionally included in the base module?
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.