evm_inode_init_security and module stacking

Casey Schaufler casey at schaufler-ca.com
Fri Jan 18 18:49:07 UTC 2019


On 1/17/2019 6:31 PM, Mimi Zohar wrote:
> On Thu, 2019-01-17 at 16:47 -0800, Casey Schaufler wrote:
>> security_inode_init_security() currently calls at most one
>> of selinux_inode_init_security() and smack_inode_init_security().
>> It then sends the result to evm_inode_init_security to create
>> the security.evm attribute. This isn't going to work on a system
>> that has both SELinux and Smack.
> Calculating security.evm based on multiple xattrs sounded really
> familiar.  Looking back at the git log, 9d8f13ba3f48 ("security: new
> security_inode_init_security API adds function callback") addressed
> filesystems wanting to be able to write all the xattrs at the same
> time and prepared for multiple LSM xattr support.

Right. That provides for security.selinux, security.SMACK64
and security.evm at the same time. What it doesn't help with
is what goes into security.evm.

>> I see two options:
>> 	- create security.evm with the information from all
>> 	  security modules that provide inode_init_security hooks
>> 	- create a separate attribute for each module,
>> 	  security.evm-selinux and security.evm-smack in the
>> 	  current case.
>>
>> How would you like to have it work? I am agnostic, although the
>> separate attributes would be easier for the infrastructure.
> Having separate attributes for each LSM module would require re-
> calculating the hmac for each one, any time any of the other file
> metadata changed.  That doesn't sound like a good idea.

OK. So it sounds like I need to gather up data from all of the
LSMs (e.g. security.selinux, security.SMACK64) and pass the combination
to evm_inode_init_security(). Will that work? Will that provide the
integrity sub-system what it needs?

> Mimi



More information about the Linux-security-module-archive mailing list