• R
    ima: Add parser of compact digest list · a863c7e7
    Roberto Sassu 提交于
    hulk inclusion
    category: feature
    feature: IMA Digest Lists extension
    bugzilla: 46797
    
    -------------------------------------------------
    
    This patch introduces the parser of the compact digest list. The format is
    optimized to store a large quantity of data with the same type. It is the
    only format supported by the kernel. Digest lists can be uploaded by
    writing the path to securityfs, as the same as for IMA policies.
    
    A compact list is a set of consecutive data blocks, each consisting of a
    header and a payload. The header indicates the version of the header, the
    type of data, type modifiers, the hash algorithm, how many elements and the
    length of the payload.
    
    COMPACT_KEY identifies public keys used for signature verification of the
    digest lists; COMPACT_PARSER identifies digests of user space parsers
    allowed to directly upload parsed digest lists to the kernel; COMPACT_FILE
    identifies digests of regular files; COMPACT_METADATA identifies digest of
    file metadata.
    
    Type modifiers indicate attributes of the elements included in the payload.
    The COMPACT_MOD_IMMUTABLE modifier indicates that a file or metadata are
    immutable.
    
    This patch also introduces ima_lookup_loaded_digest() and
    ima_add_digest_data_entry() to search and add digests in the new hash table
    (ima_digests_htable).
    Signed-off-by: NRoberto Sassu <roberto.sassu@huawei.com>
    Signed-off-by: NTianxing Zhang <zhangtianxing3@huawei.com>
    Reviewed-by: NJason Yan <yanaijie@huawei.com>
    Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
    a863c7e7
integrity.h 8.3 KB