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:   Fri, 27 May 2022 14:29:53 -0700
From:   Kees Cook <keescook@...omium.org>
To:     Ming Qian <ming.qian@....com>
Cc:     Kees Cook <keescook@...omium.org>, Shijie Qin <shijie.qin@....com>,
        Zhou Peng <eagle.zhou@....com>,
        Mauro Carvalho Chehab <mchehab@...nel.org>,
        "Gustavo A . R . Silva" <gustavoars@...nel.org>,
        linux-media@...r.kernel.org,
        Hans Verkuil <hverkuil-cisco@...all.nl>,
        Nicolas Dufresne <nicolas.dufresne@...labora.com>,
        linux-kernel@...r.kernel.org, linux-hardening@...r.kernel.org
Subject: [PATCH] media: amphion: Replace zero-length array with flexible-array member

There is a regular need in the kernel to provide a way to declare
having a dynamically sized set of trailing elements in a structure.
Kernel code should always use “flexible array members”[1] for these
cases. The older style of one-element or zero-length arrays should no
longer be used[2][3].

[1] https://en.wikipedia.org/wiki/Flexible_array_member
[2] https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays
[3] https://github.com/KSPP/linux/issues/78

Fixes: 9f599f351e86 ("media: amphion: add vpu core driver")
Cc: Ming Qian <ming.qian@....com>
Cc: Shijie Qin <shijie.qin@....com>
Cc: Zhou Peng <eagle.zhou@....com>
Cc: Mauro Carvalho Chehab <mchehab@...nel.org>
Cc: Gustavo A. R. Silva <gustavoars@...nel.org>
Cc: linux-media@...r.kernel.org
Signed-off-by: Kees Cook <keescook@...omium.org>
---
 drivers/media/platform/amphion/vpu_dbg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/platform/amphion/vpu_dbg.c b/drivers/media/platform/amphion/vpu_dbg.c
index da62bd718fb8..f72c8a506b22 100644
--- a/drivers/media/platform/amphion/vpu_dbg.c
+++ b/drivers/media/platform/amphion/vpu_dbg.c
@@ -27,7 +27,7 @@ struct print_buf_desc {
 	u32 bytes;
 	u32 read;
 	u32 write;
-	char buffer[0];
+	char buffer[];
 };
 
 static char *vb2_stat_name[] = {
-- 
2.32.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ