diff options
| author | Bryam Vargas <hexlabsecurity@proton.me> | 2026-07-31 12:44:10 -0500 |
|---|---|---|
| committer | Paul Moore <paul@paul-moore.com> | 2026-08-03 16:03:56 -0400 |
| commit | b98a8ac50775540f3804397ed08f61ef9910bcab (patch) | |
| tree | 392ede3bbcf1d8c675b13fc41b15cf2e2772050f /tools/perf/scripts/python/export-to-postgresql.py | |
| parent | e5c0235a3c4e9eb047a16cd02323fe4ecf2f570e (diff) | |
selinux: require a class's permission values to cover its permission count
security_get_permissions() sizes an array by the class's permissions.nprim
and fills it at value - 1, from the inherited common's permission table and
then the class's own. A value no permission defines leaves a NULL that
sel_make_perm_files() passes to d_alloc_name(), an oops inside
sel_write_load() that strands selinux_state.policy_mutex and leaves every
later load in uninterruptible sleep; two permissions sharing a value
overwrite the first kstrdup(). Bounding each value by nprim catches
neither, and neither would a count: the symbol table is keyed on the
permission name, so duplicates pass.
Track the values each permission table claims and require them to cover
exactly what its count declares, rejecting a count no value can reach.
Conforming policies 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/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions
