Re: [PATCH] ubsan: Remove 1-element array usage in debug reporting

From: Gustavo A. R. Silva
Date: Wed Apr 24 2024 - 17:15:01 EST




On 24/04/24 10:27, Kees Cook wrote:
The "type_name" character array was still marked as a 1-element array.
While we don't validate strings used in format arguments yet, let's fix
this before it causes trouble some future day.

Signed-off-by: Kees Cook <keescook@xxxxxxxxxxxx>

Reviewed-by: Gustavo A. R. Silva <gustavoars@xxxxxxxxxx>

Thanks!
--
Gustavo

---
Cc: Gustavo A. R. Silva <gustavoars@xxxxxxxxxx>
Cc: Marco Elver <elver@xxxxxxxxxx>
Cc: Andrey Konovalov <andreyknvl@xxxxxxxxx>
Cc: Andrey Ryabinin <ryabinin.a.a@xxxxxxxxx>
Cc: kasan-dev@xxxxxxxxxxxxxxxx
Cc: linux-hardening@xxxxxxxxxxxxxxx
---
lib/ubsan.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/ubsan.h b/lib/ubsan.h
index 0abbbac8700d..50ef50811b7c 100644
--- a/lib/ubsan.h
+++ b/lib/ubsan.h
@@ -43,7 +43,7 @@ enum {
struct type_descriptor {
u16 type_kind;
u16 type_info;
- char type_name[1];
+ char type_name[];
};
struct source_location {