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]
Message-Id: <20251208023723.19789-1-chenchangcheng@kylinos.cn>
Date: Mon,  8 Dec 2025 10:37:23 +0800
From: Chen Changcheng <chenchangcheng@...inos.cn>
To: richard@....at,
	anton.ivanov@...bridgegreys.com
Cc: johannes@...solutions.net,
	benjamin.berg@...el.com,
	linux-um@...ts.infradead.org,
	linux-kernel@...r.kernel.org,
	Chen Changcheng <chenchangcheng@...inos.cn>,
	kernel test robot <lkp@...el.com>
Subject: [PATCH] um: use ARRAY_SIZE to calculate the length of an array

cocci warnings: (new ones prefixed by >>)
>> arch/um/kernel/skas/stub_exe.c:180:23-24: WARNING: Use ARRAY_SIZE

Fixes: 406d17c6c370 ("um: Implement kernel side of SECCOMP based process handling")
Reported-by: kernel test robot <lkp@...el.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202512080556.BbmGuwU4-lkp@intel.com/
Signed-off-by: Chen Changcheng <chenchangcheng@...inos.cn>
---
 arch/um/kernel/skas/stub_exe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/um/kernel/skas/stub_exe.c b/arch/um/kernel/skas/stub_exe.c
index cbafaa684e66..01a938a5bb4f 100644
--- a/arch/um/kernel/skas/stub_exe.c
+++ b/arch/um/kernel/skas/stub_exe.c
@@ -193,7 +193,7 @@ noinline static void real_init(void)
 			BPF_STMT(BPF_RET | BPF_K, SECCOMP_RET_ALLOW),
 		};
 		struct sock_fprog prog = {
-			.len = sizeof(filter) / sizeof(filter[0]),
+			.len = ARRAY_SIZE(filter),
 			.filter = filter,
 		};
 
-- 
2.25.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ