imx8mn: buffer overflow in low_drive_gpu_freq()
Subsystems (3)
PATCH 1/1 imx8mn: buffer overflow in low_drive_gpu_freq()
Avoid a buffer overflow if assigned-clock-rates has less than two elements.
Fixes 98bcdf16356c ("imx8mn: Add low drive mode support for DDR4/LPDDR4 EVK")
Signed-off-by Heinrich Schuchardt <[email protected]>
--- arch/arm/mach-imx/imx8m/soc.c | 2 ++ 1 file changed, 2 insertions(+)
arch/arm/mach-imx/imx8m/soc.c +2 -0
@@ -914,6 +914,8 @@ static int low_drive_gpu_freq(void *blob)if (cnt !=7 )printf ("Warning: %s, assigned-clock-rates count %d\n" , nodes_path_8mn[0 ], cnt); +if (cnt <2 ) +return -1 ; assignedclks[cnt -1 ] =200000000 ; assignedclks[cnt -2 ] =200000000 ;
Signature · 1 line
2.39.2
Quoted 4 lines · Heinrich Schuchardt
Avoid a buffer overflow if assigned-clock-rates has less than two elements.
Fixes 98bcdf16356c ("imx8mn: Add low drive mode support for DDR4/LPDDR4 EVK")Signed-off-by Heinrich Schuchardt <[email protected]>
Reviewed-by Peng Fan <[email protected]>
Quoted 17 lines
--- arch/arm/mach-imx/imx8m/soc.c | 2 ++ 1 file changed, 2 insertions(+)arch/arm/mach-imx/imx8m/soc.c +2
-0@@ -914,6 +914,8 @@ static int low_drive_gpu_freq(void *blob)if (cnt !=7 )printf ("Warning: %s, assigned-clock-rates count %d\n" , nodes_path_8mn[0 ], cnt); +if (cnt <2 ) +return -1 ; assignedclks[cnt -1 ] =200000000 ; assignedclks[cnt -2 ] =200000000 ;
Quoted 4 lines · Heinrich Schuchardt
Avoid a buffer overflow if assigned-clock-rates has less than two elements.
Fixes 98bcdf16356c ("imx8mn: Add low drive mode support for DDR4/LPDDR4 EVK")Signed-off-by Heinrich Schuchardt <[email protected]>
Reviewed-by Peng Fan <[email protected]>
Quoted 17 lines
--- arch/arm/mach-imx/imx8m/soc.c | 2 ++ 1 file changed, 2 insertions(+)arch/arm/mach-imx/imx8m/soc.c +2
-0@@ -914,6 +914,8 @@ static int low_drive_gpu_freq(void *blob)if (cnt !=7 )printf ("Warning: %s, assigned-clock-rates count %d\n" , nodes_path_8mn[0 ], cnt); +if (cnt <2 ) +return -1 ; assignedclks[cnt -1 ] =200000000 ; assignedclks[cnt -2 ] =200000000 ;
PATCH 1/1 imx8mn: buffer overflow in low_drive_gpu_freq()
In reply to Heinrich SchuchardtQuoted 5 lines
Avoid a buffer overflow if assigned-clock-rates has less than two elements.
Fixes 98bcdf16356c ("imx8mn: Add low drive mode support for DDR4/LPDDR4 EVK")Signed-off-by Heinrich Schuchardt <[email protected]>Reviewed-by Peng Fan <[email protected]>Reviewed-by Peng Fan <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Erika Unter HRB 165235 Munich, Office: Kirchenstr.5, 82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected] =====================================================================