Re: [PATCH bpf-next v2 3/3] bpf: Update LSM selftests for bpf_ima_inode_hash

2020-11-23 Thread Yonghong Song
On 11/23/20 10:54 AM, Yonghong Song wrote: On 11/23/20 10:46 AM, KP Singh wrote: On Mon, Nov 23, 2020 at 7:36 PM Yonghong Song wrote: On 11/23/20 10:27 AM, KP Singh wrote: [...] Even if a custom policy has been loaded, potentially additional measurements unrelated to this test

Re: [PATCH bpf-next v2 3/3] bpf: Update LSM selftests for bpf_ima_inode_hash

2020-11-23 Thread Yonghong Song
On 11/23/20 10:46 AM, KP Singh wrote: On Mon, Nov 23, 2020 at 7:36 PM Yonghong Song wrote: On 11/23/20 10:27 AM, KP Singh wrote: [...] Even if a custom policy has been loaded, potentially additional measurements unrelated to this test would be included the measurement list. One way

Re: [PATCH bpf-next v2 3/3] bpf: Update LSM selftests for bpf_ima_inode_hash

2020-11-23 Thread KP Singh
On Mon, Nov 23, 2020 at 7:36 PM Yonghong Song wrote: > > > > On 11/23/20 10:27 AM, KP Singh wrote: > > [...] > > > > Even if a custom policy has been loaded, potentially additional > measurements unrelated to this test would be included the measurement > list. One way of

Re: [PATCH bpf-next v2 3/3] bpf: Update LSM selftests for bpf_ima_inode_hash

2020-11-23 Thread Yonghong Song
On 11/23/20 10:27 AM, KP Singh wrote: [...] Even if a custom policy has been loaded, potentially additional measurements unrelated to this test would be included the measurement list. One way of limiting a rule to a specific test is by loopback mounting a file system and defining a policy

Re: [PATCH bpf-next v2 3/3] bpf: Update LSM selftests for bpf_ima_inode_hash

2020-11-23 Thread KP Singh
[...] > > > > > > Even if a custom policy has been loaded, potentially additional > > > measurements unrelated to this test would be included the measurement > > > list. One way of limiting a rule to a specific test is by loopback > > > mounting a file system and defining a policy rule based on

Re: [PATCH bpf-next v2 3/3] bpf: Update LSM selftests for bpf_ima_inode_hash

2020-11-23 Thread Mimi Zohar
[Cc'ing Petr Vorel] On Mon, 2020-11-23 at 15:06 +0100, KP Singh wrote: > On Mon, Nov 23, 2020 at 2:24 PM Mimi Zohar wrote: > > > > On Sat, 2020-11-21 at 00:50 +, KP Singh wrote: > > > From: KP Singh > > > > > > - Update the IMA policy before executing the test binary (this is not an > > >

Re: [PATCH bpf-next v2 3/3] bpf: Update LSM selftests for bpf_ima_inode_hash

2020-11-23 Thread KP Singh
On Mon, Nov 23, 2020 at 2:24 PM Mimi Zohar wrote: > > On Sat, 2020-11-21 at 00:50 +, KP Singh wrote: > > From: KP Singh > > > > - Update the IMA policy before executing the test binary (this is not an > > override of the policy, just an append that ensures that hashes are > > calculated

Re: [PATCH bpf-next v2 3/3] bpf: Update LSM selftests for bpf_ima_inode_hash

2020-11-23 Thread Mimi Zohar
On Sat, 2020-11-21 at 00:50 +, KP Singh wrote: > From: KP Singh > > - Update the IMA policy before executing the test binary (this is not an > override of the policy, just an append that ensures that hashes are > calculated on executions). Assuming the builtin policy has been replaced

[PATCH bpf-next v2 3/3] bpf: Update LSM selftests for bpf_ima_inode_hash

2020-11-20 Thread KP Singh
From: KP Singh - Update the IMA policy before executing the test binary (this is not an override of the policy, just an append that ensures that hashes are calculated on executions). - Call the bpf_ima_inode_hash in the bprm_committed_creds hook and check if the call succeeded and a hash