commit ff7fb470a1dbd5ab72bcc74732b53ac043759bb5
Author: Lawrence Mok <lawrence.mok@amlogic.com>
Date:   Wed Sep 4 17:08:09 2024 -0700

    scs: re-init return variable to fail code, disable optimization [1/1]

    PD#RSP-6589

    Problem:
    Need to prevent glitch attack skipping a statement and using
    previously assigned hardened successful return value from being
    used.
    Finding ID 24

    Solution:
    re-initialize to failure and disable compiler optimization

    Verify:
    ./build.sh s6 with and without change
    ls bl32.* before:
    -rw-r--r-- 1 649328 ./bl32.bin
    -rw-r--r-- 1 649840 ./bl32.img

    after
    -rw-r--r-- 1 653424 ./bl32.bin
    -rw-r--r-- 1 653936 ./bl32.img

    Change-Id: Iaebf62384294480422fb0fd239e784e1b4bb5979
    Signed-off-by: Lawrence Mok <lawrence.mok@amlogic.com>

Change-Id: I619bb59b1704b8a751c73b79663c390d9ba13308
31 files changed