selinux: reject an unclaimed class value in security_get_classes()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 55fcf09b3fe4325c9395ebbb0322a547a157ebc7 · < 841aea4d5a25e16273d04cd07a74142b4687e03b| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
selinux: reject an unclaimed class value in security_get_classes()
security_get_classes() sizes an array by p_classes.nprim and fills it at value - 1, so a class value the policy never defines leaves a NULL. sel_make_classes() passes every entry to sel_make_dir(), reaching the same d_alloc_name() dereference as the permission array. The class symbol table is allowed to be sparse (policydb_class_isvalid() exists to absorb that), but this getter builds its own array straight from the hash table and has no such predicate.
Fail the lookup when a value went unclaimed instead of handing out the NULL. Conforming policies define every class they declare and are unaffected.
From the CVE record · Linux
The SELinux class getter can leave a NULL entry when a policy declares a class value it does not define, leading to a NULL dereference. A policy with such a gap could trigger a kernel crash; the input does not specify whether an attacker can supply the policy or whether authentication or user interaction is required.
Engineers running Linux kernels with SELinux should check their kernel versions; affected versions are not specified.