]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
net: airoha: avoid out of boundary writing/access to gdm_port_str[] array
authorMikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Wed, 11 Feb 2026 18:22:17 +0000 (21:22 +0300)
committerJerome Forissier <jerome.forissier@arm.com>
Thu, 12 Mar 2026 11:49:35 +0000 (12:49 +0100)
In the case of an7581 possible GDM port id are: 1, 2 and 4.
Initialization of port GDM4 will lead to out of boundary writing
to gdm_port_str[] array.

Let's increase the array size by 1 to avoid it.

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
drivers/net/airoha_eth.c

index 2007642ebae46350d474a1a6f8ff01e2874c61e9..171fb0825fa8b1178d7ca1a243dbf351b3fd17dd 100644 (file)
@@ -331,7 +331,7 @@ struct airoha_eth {
        struct airoha_eth_soc_data *soc;
 
        struct airoha_qdma qdma[AIROHA_MAX_NUM_QDMA];
-       char gdm_port_str[AIROHA_MAX_NUM_GDM_PORTS][AIROHA_GDM_PORT_STRING_LEN];
+       char gdm_port_str[AIROHA_MAX_NUM_GDM_PORTS + 1][AIROHA_GDM_PORT_STRING_LEN];
 };
 
 struct airoha_eth_soc_data {