From 34edaed563e78081ce17ff1f682628c11d337bf2 Mon Sep 17 00:00:00 2001 From: Sandrine Bailleux Date: Mon, 2 Dec 2013 15:45:07 +0000 Subject: [PATCH] BL2: Sanity check value in x0 in the entry point code Change-Id: Icef68e314e6ba0f3694189b57f4b1dbbea5ba255 --- bl2/aarch64/bl2_entrypoint.S | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bl2/aarch64/bl2_entrypoint.S b/bl2/aarch64/bl2_entrypoint.S index 75970f74..03d08480 100644 --- a/bl2/aarch64/bl2_entrypoint.S +++ b/bl2/aarch64/bl2_entrypoint.S @@ -77,6 +77,14 @@ bl2_entrypoint:; .type bl2_entrypoint, %function isb + /* --------------------------------------------- + * Check the opcodes out of paranoia. + * --------------------------------------------- + */ + mov x0, #RUN_IMAGE + cmp x0, x20 + b.ne _panic + /* --------------------------------------------- * Zero out NOBITS sections. There are 2 of them: * - the .bss section; -- 2.30.2