• Stefan Berger's avatar
    evm: Enforce signatures on unsupported filesystem for EVM_INIT_X509 · 47add87a
    Stefan Berger authored
    Unsupported filesystems currently do not enforce any signatures. Add
    support for signature enforcement of the "original" and "portable &
    immutable" signatures when EVM_INIT_X509 is enabled.
    
    The "original" signature type contains filesystem specific metadata.
    Thus it cannot be copied up and verified. However with EVM_INIT_X509
    and EVM_ALLOW_METADATA_WRITES enabled, the "original" file signature
    may be written.
    
    When EVM_ALLOW_METADATA_WRITES is not set or once it is removed from
    /sys/kernel/security/evm by setting EVM_INIT_HMAC for example, it is not
    possible to write or remove xattrs on the overlay filesystem.
    
    This change still prevents EVM from writing HMAC signatures on
    unsupported filesystem when EVM_INIT_HMAC is enabled.
    Co-developed-by: default avatarMimi Zohar <zohar@linux.ibm.com>
    Signed-off-by: default avatarStefan Berger <stefanb@linux.ibm.com>
    Signed-off-by: default avatarMimi Zohar <zohar@linux.ibm.com>
    47add87a
evm_main.c 31.3 KB