dm verity: add root hash pkcs#7 signature verification
mainline inclusion from mainline-v5.4-rc1 commit 88cd3e6c category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I5CES3 CVE: NA -------------------------------- The verification is to support cases where the root hash is not secured by Trusted Boot, UEFI Secureboot or similar technologies. One of the use cases for this is for dm-verity volumes mounted after boot, the root hash provided during the creation of the dm-verity volume has to be secure and thus in-kernel validation implemented here will be used before we trust the root hash and allow the block device to be created. The signature being provided for verification must verify the root hash and must be trusted by the builtin keyring for verification to succeed. The hash is added as a key of type "user" and the description is passed to the kernel so it can look it up and use it for verification. Adds CONFIG_DM_VERITY_VERIFY_ROOTHASH_SIG which can be turned on if root hash verification is needed. Kernel commandline dm_verity module parameter 'require_signatures' will indicate whether to force root hash signature verification (for all dm verity volumes). Signed-off-by: NJaskaran Khurana <jaskarankhurana@linux.microsoft.com> Tested-and-Reviewed-by: NMilan Broz <gmazyland@gmail.com> Signed-off-by: NMike Snitzer <snitzer@redhat.com> Conflicts: Documentation/admin-guide/device-mapper/verity.rst drivers/md/dm-verity-target.c Signed-off-by: NLuo Meng <luomeng12@huawei.com> Reviewed-by: NJason Yan <yanaijie@huawei.com> Signed-off-by: NYongqiang Liu <liuyongqiang13@huawei.com>
Showing
drivers/md/dm-verity-verify-sig.c
0 → 100644
drivers/md/dm-verity-verify-sig.h
0 → 100644
想要评论请 注册 或 登录