]> git.baikalelectronics.ru Git - kernel.git/commit
bpf-lsm: Introduce new helper bpf_ima_file_hash()
authorRoberto Sassu <roberto.sassu@huawei.com>
Wed, 2 Mar 2022 11:13:58 +0000 (12:13 +0100)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 11 Mar 2022 02:57:54 +0000 (18:57 -0800)
commit4f7e3dcb515c7633a460ce5bf99b0ac71dcf2276
treeaf73026e68606f8644001ae28e60509cedc642c7
parent673b979dc47869e3e5d55c9f3b167b48c87df8b9
bpf-lsm: Introduce new helper bpf_ima_file_hash()

ima_file_hash() has been modified to calculate the measurement of a file on
demand, if it has not been already performed by IMA or the measurement is
not fresh. For compatibility reasons, ima_inode_hash() remains unchanged.

Keep the same approach in eBPF and introduce the new helper
bpf_ima_file_hash() to take advantage of the modified behavior of
ima_file_hash().

Signed-off-by: Roberto Sassu <roberto.sassu@huawei.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20220302111404.193900-4-roberto.sassu@huawei.com
include/uapi/linux/bpf.h
kernel/bpf/bpf_lsm.c
tools/include/uapi/linux/bpf.h