3 Contact: Mimi Zohar <zohar@us.ibm.com>
5 EVM protects a file's security extended attributes(xattrs)
6 against integrity attacks. The initial method maintains an
7 HMAC-sha1 value across the extended attributes, storing the
8 value as the extended attribute 'security.evm'.
10 EVM supports two classes of security.evm. The first is
11 an HMAC-sha1 generated locally with a
12 trusted/encrypted key stored in the Kernel Key
13 Retention System. The second is a digital signature
14 generated either locally or remotely using an
15 asymmetric key. These keys are loaded onto root's
16 keyring using keyctl, and EVM is then enabled by
17 echoing a value to <securityfs>/evm made up of the
20 === ==================================================
22 === ==================================================
23 0 Enable HMAC validation and creation
24 1 Enable digital signature validation
25 2 Permit modification of EVM-protected metadata at
26 runtime. Not supported if HMAC validation and
28 31 Disable further runtime modification of EVM policy
29 === ==================================================
33 echo 1 ><securityfs>/evm
35 will enable HMAC validation and creation
39 echo 0x80000003 ><securityfs>/evm
41 will enable HMAC and digital signature validation and
42 HMAC creation and disable all further modification of policy.
46 echo 0x80000006 ><securityfs>/evm
48 will enable digital signature validation, permit
49 modification of EVM-protected metadata and
50 disable all further modification of policy
52 Echoing a value is additive, the new value is added to the
53 existing initialization flags.
57 echo 2 ><securityfs>/evm
59 another echo can be performed::
61 echo 1 ><securityfs>/evm
63 and the resulting value will be 3.
65 Note that once an HMAC key has been loaded, it will no longer
66 be possible to enable metadata modification. Signaling that an
67 HMAC key has been loaded will clear the corresponding flag.
68 For example, if the current value is 6 (2 and 4 set)::
70 echo 1 ><securityfs>/evm
72 will set the new value to 3 (4 cleared).
74 Loading an HMAC key is the only way to disable metadata
77 Until key loading has been signaled EVM can not create
78 or validate the 'security.evm' xattr, but returns
79 INTEGRITY_UNKNOWN. Loading keys and signaling EVM
80 should be done as early as possible. Normally this is
81 done in the initramfs, which has already been measured
82 as part of the trusted boot. For more information on
83 creating and loading existing trusted/encrypted keys,
85 Documentation/security/keys/trusted-encrypted.rst. Both
86 dracut (via 97masterkey and 98integrity) and systemd (via
87 core/ima-setup) have support for loading keys at boot
90 What: security/integrity/evm/evm_xattrs
92 Contact: Matthew Garrett <mjg59@google.com>
94 Shows the set of extended attributes used to calculate or
95 validate the EVM signature, and allows additional attributes
96 to be added at runtime. Any signatures generated after
97 additional attributes are added (and on files possessing those
98 additional attributes) will only be valid if the same
99 additional attributes are configured on system boot. Writing
100 a single period (.) will lock the xattr list from any further