1. 29 3月, 2023 1 次提交
  2. 07 12月, 2022 2 次提交
  3. 02 11月, 2022 3 次提交
  4. 27 9月, 2022 2 次提交
    • G
      ima: remove the IMA_TEMPLATE Kconfig option · caf0cb29
      GUO Zihua 提交于
      stable inclusion
      from stable-v5.10.121
      commit b67adaec347ddb759d34478da9bf56168798350d
      category: bugfix
      bugzilla: https://gitee.com/openeuler/kernel/issues/I5L6CQ
      
      Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=b67adaec347ddb759d34478da9bf56168798350d
      
      --------------------------------
      
      commit 891163ad upstream.
      
      The original 'ima' measurement list template contains a hash, defined
      as 20 bytes, and a null terminated pathname, limited to 255
      characters.  Other measurement list templates permit both larger hashes
      and longer pathnames.  When the "ima" template is configured as the
      default, a new measurement list template (ima_template=) must be
      specified before specifying a larger hash algorithm (ima_hash=) on the
      boot command line.
      
      To avoid this boot command line ordering issue, remove the legacy "ima"
      template configuration option, allowing it to still be specified on the
      boot command line.
      
      The root cause of this issue is that during the processing of ima_hash,
      we would try to check whether the hash algorithm is compatible with the
      template. If the template is not set at the moment we do the check, we
      check the algorithm against the configured default template. If the
      default template is "ima", then we reject any hash algorithm other than
      sha1 and md5.
      
      For example, if the compiled default template is "ima", and the default
      algorithm is sha1 (which is the current default). In the cmdline, we put
      in "ima_hash=sha256 ima_template=ima-ng". The expected behavior would be
      that ima starts with ima-ng as the template and sha256 as the hash
      algorithm. However, during the processing of "ima_hash=",
      "ima_template=" has not been processed yet, and hash_setup would check
      the configured hash algorithm against the compiled default: ima, and
      reject sha256. So at the end, the hash algorithm that is actually used
      will be sha1.
      
      With template "ima" removed from the configured default, we ensure that
      the default tempalte would at least be "ima-ng" which allows for
      basically any hash algorithm.
      
      This change would not break the algorithm compatibility checks for IMA.
      
      Fixes: 4286587d ("ima: add Kconfig default measurement list template")
      Signed-off-by: NGUO Zihua <guozihua@huawei.com>
      Cc: <Stable@vger.kernel.org>
      Signed-off-by: NMimi Zohar <zohar@linux.ibm.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
      Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
      caf0cb29
    • A
      efi: Do not import certificates from UEFI Secure Boot for T2 Macs · ded37e1d
      Aditya Garg 提交于
      stable inclusion
      from stable-v5.10.121
      commit c072cab98bac11f6ef9db640fb51834d9552e2e6
      category: bugfix
      bugzilla: https://gitee.com/openeuler/kernel/issues/I5L6CQ
      
      Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=c072cab98bac11f6ef9db640fb51834d9552e2e6
      
      --------------------------------
      
      commit 155ca952 upstream.
      
      On Apple T2 Macs, when Linux attempts to read the db and dbx efi variables
      at early boot to load UEFI Secure Boot certificates, a page fault occurs
      in Apple firmware code and EFI runtime services are disabled with the
      following logs:
      
      [Firmware Bug]: Page fault caused by firmware at PA: 0xffffb1edc0068000
      WARNING: CPU: 3 PID: 104 at arch/x86/platform/efi/quirks.c:735 efi_crash_gracefully_on_page_fault+0x50/0xf0
      (Removed some logs from here)
      Call Trace:
       <TASK>
       page_fault_oops+0x4f/0x2c0
       ? search_bpf_extables+0x6b/0x80
       ? search_module_extables+0x50/0x80
       ? search_exception_tables+0x5b/0x60
       kernelmode_fixup_or_oops+0x9e/0x110
       __bad_area_nosemaphore+0x155/0x190
       bad_area_nosemaphore+0x16/0x20
       do_kern_addr_fault+0x8c/0xa0
       exc_page_fault+0xd8/0x180
       asm_exc_page_fault+0x1e/0x30
      (Removed some logs from here)
       ? __efi_call+0x28/0x30
       ? switch_mm+0x20/0x30
       ? efi_call_rts+0x19a/0x8e0
       ? process_one_work+0x222/0x3f0
       ? worker_thread+0x4a/0x3d0
       ? kthread+0x17a/0x1a0
       ? process_one_work+0x3f0/0x3f0
       ? set_kthread_struct+0x40/0x40
       ? ret_from_fork+0x22/0x30
       </TASK>
      ---[ end trace 1f82023595a5927f ]---
      efi: Froze efi_rts_wq and disabled EFI Runtime Services
      integrity: Couldn't get size: 0x8000000000000015
      integrity: MODSIGN: Couldn't get UEFI db list
      efi: EFI Runtime Services are disabled!
      integrity: Couldn't get size: 0x8000000000000015
      integrity: Couldn't get UEFI dbx list
      integrity: Couldn't get size: 0x8000000000000015
      integrity: Couldn't get mokx list
      integrity: Couldn't get size: 0x80000000
      
      So we avoid reading these UEFI variables and thus prevent the crash.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NAditya Garg <gargaditya08@live.com>
      Reviewed-by: NMimi Zohar <zohar@linux.ibm.com>
      Signed-off-by: NMimi Zohar <zohar@linux.ibm.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
      Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
      ded37e1d
  5. 26 7月, 2022 1 次提交
  6. 05 7月, 2022 1 次提交
  7. 18 5月, 2022 4 次提交
  8. 11 3月, 2022 1 次提交
  9. 29 12月, 2021 25 次提交