From: KP Singh <kpsingh@xxxxxxxxxx> # v2 -> v3 - Fixed an issue pointed out by Alexei, the helper should only be exposed to sleepable hooks. - Update the selftests to constrain the IMA policy udpate to a loopback filesystem specifically created for the test. Also, split this out from the LSM test. I dropped the Ack from this last patch since this is a re-write. KP Singh (3): ima: Implement ima_inode_hash bpf: Add a BPF helper for getting the IMA hash of an inode bpf: Add a selftest for bpf_ima_inode_hash include/linux/ima.h | 6 ++ include/uapi/linux/bpf.h | 11 +++ kernel/bpf/bpf_lsm.c | 26 ++++++ scripts/bpf_helpers_doc.py | 2 + security/integrity/ima/ima_main.c | 78 ++++++++++++------ tools/include/uapi/linux/bpf.h | 11 +++ tools/testing/selftests/bpf/config | 4 + tools/testing/selftests/bpf/ima_setup.sh | 80 +++++++++++++++++++ .../selftests/bpf/prog_tests/test_ima.c | 74 +++++++++++++++++ tools/testing/selftests/bpf/progs/ima.c | 28 +++++++ 10 files changed, 296 insertions(+), 24 deletions(-) create mode 100644 tools/testing/selftests/bpf/ima_setup.sh create mode 100644 tools/testing/selftests/bpf/prog_tests/test_ima.c create mode 100644 tools/testing/selftests/bpf/progs/ima.c -- 2.29.2.454.gaff20da3a2-goog