platform/x86/intel/ifs: Add metadata validation
mainline inclusion from mainline-v6.2-rc1 commit 48c6e7dc category: feature feature: Backport Intel In Field Scan(IFS) multi-blob images support bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I6L337 CVE: N/A Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/ commit/?id=48c6e7dc Intel-SIG: commit 48c6e7dc ("platform/x86/intel/ifs: Add metadata validation") ------------------------------------- platform/x86/intel/ifs: Add metadata validation The data portion of a IFS test image file contains a metadata region containing possibly multiple metadata structures in addition to test data and hashes. IFS Metadata layout +----------------------+ 0 |META_TYPE_IFS (=1) | +----------------------+ |meta_size | +----------------------+ |test type | +----------------------+ |fusa info | +----------------------+ |total images | +----------------------+ |current image# | +----------------------+ |total chunks | +----------------------+ |starting chunk | +----------------------+ |size per chunk | +----------------------+ |chunks per stride | +----------------------+ |Reserved[54] | +----------------------+ 256 | | | Test Data/Chunks | | | +----------------------+ meta_size | META_TYPE_END (=0) | +----------------------+ meta_size + 4 | size of end (=8) | +----------------------+ meta_size + 8 Introduce the layout of this meta_data structure and validate the sanity of certain fields of the new image before loading. Tweak references to IFS test image chunks to reflect the updated layout of the test image. [ bp: Massage commit message. ] Signed-off-by: NJithu Joseph <jithu.joseph@intel.com> Signed-off-by: NBorislav Petkov <bp@suse.de> Reviewed-by: NTony Luck <tony.luck@intel.com> Reviewed-by: NSohil Mehta <sohil.mehta@intel.com> Reviewed-by: NHans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20221117230408.30331-1-jithu.joseph@intel.comSigned-off-by: NAichun Shi <aichun.shi@intel.com>
Showing
想要评论请 注册 或 登录