Navigation

    全志在线开发者论坛

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • 在线文档
    • 社区主页

    【FAQ】全志R329Tina安全启动校验linux/rootfs失败直接重启如何解决?

    其它全志芯片讨论区
    r329 r328 r818 faq 技术支持
    2
    2
    1527
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • q1215200171
      budbool LV 9 last edited by

      问题描述

      客户发现在安全启动时,如果uboot中校验linux、rootfs失败,会进入uboot控制台,不符合他们的安全要求。

      他们希望校验失败重启或停止运行。

      问题分析

      默认情况下,Tina安全启动中:

      • 如果brom校验toc0(sboot)失败,会跳fel烧写;
      • 如果sboot校验toc1(bl31/optee/uboot等)失败,会跳fel烧写;
      • 如果uboot校验linux、rootfs失败,会进入uboot控制台。

      可以根据不同客户的安全需求进行定制。

      解决办法

      参考下面补丁修改tina/lichee/brandy-2.0/u-boot-2018/cmd/bootm.c文件

      diff --git a/cmd/bootm.c b/cmd/bootm.c
      index 0a267b4251..887c1f0a79 100644
      --- a/cmd/bootm.c
      +++ b/cmd/bootm.c
      @@ -248,13 +248,17 @@ int do_bootm(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
                              full = 0;
                      }
                      if (sunxi_verify_partion(&verify_pattern, rootfs_name, "rootfs", full) != 0) {
      -                       return -1;
      +                       gd->debug_mode = 8;
      +                       printf("sunxi verify rootfs fail, reboot\n");
      +                       reset_cpu(0);
                      }
       #endif /*CONFIG_SUNXI_PART_VERIFY*/
      
                      if (sunxi_verify_os(os_load_addr,
                                          env_get("boot_from_partion")) != 0) {
      -                       return -1;
      +                       gd->debug_mode = 8;
      +                       printf("sunxi verify linux kernel fail, reboot\n");
      +                       reset_cpu(0);
                      }
              }
       #endif /*CONFIG_SUNXI_SECURE_BOOT*/
      
      1 Reply Last reply Reply Quote Share 0
      • M
        mengxp LV 5 last edited by

        sbrom校验toc0失败,进入fel模式后,可以使用sunxi-fel工具写sram并执行代码,这算是绕过secureboot了吧?这怎么能行,请问如何解决?

        1 Reply Last reply Reply Quote Share 0
        • Referenced by  q1215200171 q1215200171 
        • Referenced by  q1215200171 q1215200171 
        • Referenced by  q1215200171 q1215200171 
        • Referenced by  q1215200171 q1215200171 
        • Referenced by  q1215200171 q1215200171 
        • 1 / 1
        • First post
          Last post

        Copyright © 2024 深圳全志在线有限公司 粤ICP备2021084185号 粤公网安备44030502007680号

        行为准则 | 用户协议 | 隐私权政策