From 6f80c397edd4fb71b3592f831c5f93838e48d7d4 Mon Sep 17 00:00:00 2001 From: Revanth Kumar Uppala Date: Wed, 19 Jun 2024 09:28:50 +0000 Subject: [PATCH] bt: realtek: Fix potential buffer overflow in cfg_list_item struct The `cfg_list_item` struct previously defined the `data` array with a zero-length, which can lead to buffer overflow issues detected by the `fortify_memcpy_chk` function. So change the zero-length array to a flexible array length. Bug 4701669 Change-Id: I3c4575efbab681fa8b6039793c410b23c4179106 Signed-off-by: Revanth Kumar Uppala Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3159595 GVS: buildbot_gerritrpt Reviewed-by: Jon Hunter Reviewed-by: Bibek Basu --- drivers/bluetooth/realtek/rtk_misc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/bluetooth/realtek/rtk_misc.c b/drivers/bluetooth/realtek/rtk_misc.c index 4e0a1219..5dec1a5f 100644 --- a/drivers/bluetooth/realtek/rtk_misc.c +++ b/drivers/bluetooth/realtek/rtk_misc.c @@ -54,7 +54,7 @@ struct cfg_list_item { struct list_head list; u16 offset; u8 len; - u8 data[0]; + u8 data[]; }; static struct list_head list_configs;