lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 19 May 2022 23:00:13 -0700
From:   Jakub Kicinski <kuba@...nel.org>
To:     davem@...emloft.net
Cc:     netdev@...r.kernel.org, edumazet@...gle.com, pabeni@...hat.com,
        Jakub Kicinski <kuba@...nel.org>, m.chetan.kumar@...el.com,
        linuxwwan@...el.com, loic.poulain@...aro.org,
        ryazanov.s.a@...il.com, johannes@...solutions.net
Subject: [PATCH net-next] wwan: iosm: use a flexible array rather than allocate short objects

GCC array-bounds warns that ipc_coredump_get_list() under-allocates
the size of struct iosm_cd_table *cd_table.

This is avoidable - we just need a flexible array. Nothing calls
sizeof() on struct iosm_cd_list or anything that contains it.

Signed-off-by: Jakub Kicinski <kuba@...nel.org>
---
CC: m.chetan.kumar@...el.com
CC: linuxwwan@...el.com
CC: loic.poulain@...aro.org
CC: ryazanov.s.a@...il.com
CC: johannes@...solutions.net
---
 drivers/net/wwan/iosm/iosm_ipc_coredump.h | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/net/wwan/iosm/iosm_ipc_coredump.h b/drivers/net/wwan/iosm/iosm_ipc_coredump.h
index 0809ba664276..3da5ec75e0f0 100644
--- a/drivers/net/wwan/iosm/iosm_ipc_coredump.h
+++ b/drivers/net/wwan/iosm/iosm_ipc_coredump.h
@@ -14,9 +14,6 @@
 /* Max buffer allocated to receive coredump data */
 #define MAX_DATA_SIZE 0x00010000
 
-/* Max number of file entries */
-#define MAX_NOF_ENTRY 256
-
 /* Max length */
 #define MAX_SIZE_LEN 32
 
@@ -38,7 +35,7 @@ struct iosm_cd_list_entry {
  */
 struct iosm_cd_list {
 	__le32 num_entries;
-	struct iosm_cd_list_entry entry[MAX_NOF_ENTRY];
+	struct iosm_cd_list_entry entry[];
 } __packed;
 
 /**
-- 
2.34.3

Powered by blists - more mailing lists