[PATCH] board: freescale: lx2160a: fix out of bounds write

Priyanka Jain (OSS) priyanka.jain at oss.nxp.com
Tue Nov 9 12:11:29 CET 2021


>-----Original Message-----
>From: U-Boot <u-boot-bounces at lists.denx.de> On Behalf Of Cosmin-Florin
>Aluchenesei
>Sent: Thursday, September 2, 2021 5:19 PM
>To: joe.hershberger at ni.com; rfried.dev at gmail.com
>Cc: Ioana Ciornei <ioana.ciornei at nxp.com>; u-boot at lists.denx.de; Aluchenesei
>Cosmin-florin <aluchenesei.cosmin-florin at nxp.com>
>Subject: [PATCH] board: freescale: lx2160a: fix out of bounds write
>
>The declaration of dpmac_str was changed in order to make the following sprintf
>safe: sprintf(dpmac_str, "ethernet@%x", dpmac_id).
>
>Signed-off-by: Cosmin-Florin Aluchenesei <aluchenesei.cosmin-florin at nxp.com>
>---
> board/freescale/lx2160a/eth_lx2160ardb.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/board/freescale/lx2160a/eth_lx2160ardb.c
>b/board/freescale/lx2160a/eth_lx2160ardb.c
>index 30a3af9f47..f3b33940e3 100644
>--- a/board/freescale/lx2160a/eth_lx2160ardb.c
>+++ b/board/freescale/lx2160a/eth_lx2160ardb.c
>@@ -233,7 +233,7 @@ void reset_phy(void)
>
> static int fdt_get_dpmac_node(void *fdt, int dpmac_id)  {
>-	char dpmac_str[] = "dpmacs at 00";
>+	char dpmac_str[11] = "dpmacs at 00";
> 	int offset, dpmacs_offset;
>
> 	/* get the dpmac offset */
>--
>2.21.0

Not able to find base code (fdt_get_dpmac_node function) for this in upstream u-boot. IS it applicable there?

Regards
Priyanka



More information about the U-Boot mailing list