eBPF-based security platform
testing: require exact privilege event records
John Fastabend65cabfe9a517
diff --git a/testing/upatch/kernel-obs/priv/priv_events.py b/testing/upatch/kernel-obs/priv/priv_events.pyindex 87946b95..300cb3b1 100644--- a/testing/upatch/kernel-obs/priv/priv_events.py+++ b/testing/upatch/kernel-obs/priv/priv_events.py@@ -21,6 +21,7 @@ MAP_ANONYMOUS = 0x20PTRACE_ATTACH = 16PTRACE_DETACH = 17PR_SET_NAME = 15+LSM_SETID_RE = 2SYSCALLS = {"x86_64": {"bpf": 321, "finit_module": 313, "init_module": 175},@@ -430,10 +431,11 @@ def check_positive(expected_path, records_path):def kind(name):matches = [record for record in selected if record["kind"] == name]- assert matches, (name, selected)+ assert len(matches) == 1, (name, matches)return matchessetuid = kind("setuid_root")[0]+ assert setuid["subtype"] == LSM_SETID_RE, setuidassert setuid["euid"] == 65534 and setuid["uid"] == 0, setuidassert int(setuid["aux"]) == 0, setuidassert setuid["name"] == expected["comm"], setuid