diff options
author | ThiƩbaud Weksteen <tweek@google.com> | 2024-12-20 07:25:58 +0300 |
---|---|---|
committer | Paul Moore <paul@paul-moore.com> | 2025-01-05 04:58:46 +0300 |
commit | 5e7f0efd23238039bcd4fc72ff28d94f364ec26b (patch) | |
tree | 2e7cd4c949f3d8a0939dc09e45c95a601bd50699 /tools/perf/scripts/python/task-analyzer.py | |
parent | 900f83cf376bdaf798b6f5dcb2eae0c822e908b6 (diff) | |
download | linux-5e7f0efd23238039bcd4fc72ff28d94f364ec26b.tar.xz |
selinux: match extended permissions to their base permissions
In commit d1d991efaf34 ("selinux: Add netlink xperm support") a new
extended permission was added ("nlmsg"). This was the second extended
permission implemented in selinux ("ioctl" being the first one).
Extended permissions are associated with a base permission. It was found
that, in the access vector cache (avc), the extended permission did not
keep track of its base permission. This is an issue for a domain that is
using both extended permissions (i.e., a domain calling ioctl() on a
netlink socket). In this case, the extended permissions were
overlapping.
Keep track of the base permission in the cache. A new field "base_perm"
is added to struct extended_perms_decision to make sure that the
extended permission refers to the correct policy permission. A new field
"base_perms" is added to struct extended_perms to quickly decide if
extended permissions apply.
While it is in theory possible to retrieve the base permission from the
access vector, the same base permission may not be mapped to the same
bit for each class (e.g., "nlmsg" is mapped to a different bit for
"netlink_route_socket" and "netlink_audit_socket"). Instead, use a
constant (AVC_EXT_IOCTL or AVC_EXT_NLMSG) provided by the caller.
Fixes: d1d991efaf34 ("selinux: Add netlink xperm support")
Signed-off-by: ThiƩbaud Weksteen <tweek@google.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'tools/perf/scripts/python/task-analyzer.py')
0 files changed, 0 insertions, 0 deletions