selinux: require every boolean value to be defined
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 · < 42a7107f99d86a7524c37f108047dfa3db096ab5| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
selinux: require every boolean value to be defined
p_bools.nprim comes from the policy image independently of how many booleans follow it, and cond_index_bool() fills bool_val_to_struct[] at value - 1, so a count larger than the values present leaves NULL entries. Every user of that array then walks it by index and dereferences each entry: cond_evaluate_expr() on the access-vector path, security_get_bools() and security_get_bool_value() behind selinuxfs, and security_set_bools(). A sparse class value is absorbed by policydb_class_isvalid() and its siblings; booleans have no such predicate, and no consumer that could use one.
Reject a boolean value that no boolean defines, once, where the array is built. Conforming policies define every boolean they declare and are unaffected.
From the CVE record · Linux
The Linux kernel's SELinux policy handling can leave undefined boolean entries when a policy image declares more booleans than it defines. Code that reads those entries can dereference a null pointer. The input does not specify attacker access requirements or whether user interaction is needed.
Engineers running Linux kernels with SELinux should check their kernel versions against the vendor advisory; affected versions are not specified.