diff options
| author | Bryam Vargas <hexlabsecurity@proton.me> | 2026-07-31 12:44:11 -0500 |
|---|---|---|
| committer | Paul Moore <paul@paul-moore.com> | 2026-08-03 16:03:56 -0400 |
| commit | 22b05fec62c0fe9864cfceb52f7d0f3a34d9b1dd (patch) | |
| tree | 2437521b13018878411f307d31eab5a420b23c9c /tools/perf/scripts/python/stackcollapse.py | |
| parent | b98a8ac50775540f3804397ed08f61ef9910bcab (diff) | |
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.
Cc: stable@vger.kernel.org
Fixes: 55fcf09b3fe4 ("selinux: add support for querying object classes and permissions from the running policy")
Signed-off-by: Bryam Vargas <hexlabsecurity@proton.me>
Acked-by: Stephen Smalley <stephen.smalley.work@gmail.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions
