Skip to contentSkip to conversation

spl: atf: Fix uninitialized pointer to bl31_image_info

PATCH New Schrempf Frieder 2 participants 3 messages Jun 27, 2019 – Jul 2, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 spl: atf: Fix uninitialized pointer to bl31_image_info

From: Frieder Schrempf <[email protected]>

The pointer to struct atf_image_info in bl31_params_mem.bl31_params.bl31_image_info is not initialized before being dereferenced. This can cause U-Boot to crash right before jumping to the BL31 ATF binary.

Fixes bcc1726a7bdd ("spl: add support to booting with ATF")
---
 common/spl/spl_atf.c | 1 +
 1 file changed, 1 insertion(+)
common/spl/spl_atf.c +1 -0
index cddab6a735..4715f9d371 100644
@@ -45,6 +45,7 @@ static struct bl31_params *bl2_plat_get_bl31_params(uintptr_t bl33_entry)
 	SET_PARAM_HEAD(bl2_to_bl31_params, ATF_PARAM_BL31, ATF_VERSION_1, 0);
 
 	/* Fill BL31 related information */
+	bl2_to_bl31_params->bl31_image_info = &bl31_params_mem.bl31_image_info;
 	SET_PARAM_HEAD(bl2_to_bl31_params->bl31_image_info,
 		       ATF_PARAM_IMAGE_BINARY, ATF_VERSION_1, 0);
 
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/1 spl: atf: Fix uninitialized pointer to bl31_image_info

Hi Frieder,

Quoted 9 lines · Schrempf Frieder

From: Frieder Schrempf <[email protected]>

The pointer to struct atf_image_info in bl31_params_mem.bl31_params.bl31_image_info is not initialized before being dereferenced. This can cause U-Boot to crash right before jumping to the BL31 ATF binary.

Fixes bcc1726a7bdd ("spl: add support to booting with ATF")

Thanks,
- Kever

Quoted 16 lines
---
 common/spl/spl_atf.c | 1 +
 1 file changed, 1 insertion(+)
common/spl/spl_atf.c +1 -0
index cddab6a735..4715f9d371 100644
@@ -45,6 +45,7 @@ static struct bl31_params *bl2_plat_get_bl31_params(uintptr_t bl33_entry)
 	SET_PARAM_HEAD(bl2_to_bl31_params, ATF_PARAM_BL31, ATF_VERSION_1, 0);
 
 	/* Fill BL31 related information */
+	bl2_to_bl31_params->bl31_image_info = &bl31_params_mem.bl31_image_info;
 	SET_PARAM_HEAD(bl2_to_bl31_params->bl31_image_info,
 		       ATF_PARAM_IMAGE_BINARY, ATF_VERSION_1, 0);
 
#2 lore raw

PATCH 1/1 spl: atf: Fix uninitialized pointer to bl31_image_info【请注意,邮件由[email protected]代发】 bl31_image_info

Quoted 6 lines · Kever Yang

Hi Frieder,

Quoted 2 lines · Schrempf Frieder

From: Frieder Schrempf <[email protected]>

Quoted 8 lines
Quoted 7 lines

The pointer to struct atf_image_info in bl31_params_mem.bl31_params.bl31_image_info is not initialized before being dereferenced. This can cause U-Boot to crash right before jumping to the BL31 ATF binary.

Fixes bcc1726a7bdd ("spl: add support to booting with ATF")

Applied to u-boot-rockchip/master

Thanks,
- Kever

Quoted 24 lines

Thanks,
- Kever

Quoted 9 lines
---
 common/spl/spl_atf.c | 1 +
 1 file changed, 1 insertion(+)
common/spl/spl_atf.c +0 -0
index cddab6a735..4715f9d371 100644

common/spl/spl_atf.c static struct bl31_params *bl2_plat_get_bl31_params(uintptr_t bl33_entry) · line 51

Quoted 7 lines
common/spl/spl_atf.c +1 -0
@@ -45,6 +45,7 @@ static struct bl31_params *bl2_plat_get_bl31_params(uintptr_t bl33_entry)
 	SET_PARAM_HEAD(bl2_to_bl31_params, ATF_PARAM_BL31, ATF_VERSION_1, 0);
 
 	/* Fill BL31 related information */
+	bl2_to_bl31_params->bl31_image_info = &bl31_params_mem.bl31_image_info;
 	SET_PARAM_HEAD(bl2_to_bl31_params->bl31_image_info,
 		       ATF_PARAM_IMAGE_BINARY, ATF_VERSION_1, 0);
 

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot