-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bpf-lsm: Extend interoperability with IMA #9
Commits on Feb 15, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 258490c - Browse repository at this point
Copy the full SHA 258490cView commit details -
ima: Fix documentation-related warnings in ima_main.c
Fix some warnings in ima_main.c, displayed with W=n make argument. Signed-off-by: Roberto Sassu <roberto.sassu@huawei.com> Reviewed-by: Shuah Khan <skhan@linuxfoundation.org>
Configuration menu - View commit details
-
Copy full SHA for f6db5ac - Browse repository at this point
Copy the full SHA f6db5acView commit details -
ima: Always return a file measurement in ima_file_hash()
__ima_inode_hash() checks if a digest has been already calculated by looking for the integrity_iint_cache structure associated to the passed inode. Users of ima_file_hash() (e.g. eBPF) might be interested in obtaining the information without having to setup an IMA policy so that the digest is always available at the time they call this function. Call ima_collect_measurement() in __ima_inode_hash(), if the file descriptor is available (passed by ima_file_hash()), and store the file measurement in a temporary integrity_iint_cache structure. This change does not cause memory usage increase, due to using the temporary integrity_iint_cache structure, and due to freeing the ima_digest_data structure inside integrity_iint_cache before exiting from __ima_inode_hash(). For compatibility reasons, the behavior of ima_inode_hash() remains unchanged. Signed-off-by: Roberto Sassu <roberto.sassu@huawei.com>
Configuration menu - View commit details
-
Copy full SHA for a6079ea - Browse repository at this point
Copy the full SHA a6079eaView commit details -
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. 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>
Configuration menu - View commit details
-
Copy full SHA for c829587 - Browse repository at this point
Copy the full SHA c829587View commit details -
selftests/bpf: Add test for bpf_ima_file_hash()
Modify the existing IMA test to call bpf_ima_file_hash() and update the expected result accordingly. Signed-off-by: Roberto Sassu <roberto.sassu@huawei.com>
Configuration menu - View commit details
-
Copy full SHA for 8b293df - Browse repository at this point
Copy the full SHA 8b293dfView commit details -
bpf-lsm: Make bpf_lsm_kernel_read_file() as sleepable
Make bpf_lsm_kernel_read_file() as sleepable, so that bpf_ima_inode_hash() or bpf_ima_file_hash() can be called inside the implementation of this hook. Signed-off-by: Roberto Sassu <roberto.sassu@huawei.com>
Configuration menu - View commit details
-
Copy full SHA for f729a20 - Browse repository at this point
Copy the full SHA f729a20View commit details -
selftests/bpf: Add test for bpf_lsm_kernel_read_file()
Test the ability of bpf_lsm_kernel_read_file() to call the sleepable functions bpf_ima_inode_hash() or bpf_ima_file_hash() to obtain a measurement of a loaded IMA policy. Signed-off-by: Roberto Sassu <roberto.sassu@huawei.com>
Configuration menu - View commit details
-
Copy full SHA for 7ad99ed - Browse repository at this point
Copy the full SHA 7ad99edView commit details