Skip to content

Commit

Permalink
xen/ubsan: Fix UB in type_descriptor declaration
Browse files Browse the repository at this point in the history
struct type_descriptor is arranged with a NUL terminated string following the
kind/info fields.

The only reason this doesn't trip UBSAN detection itself (on more modern
compilers at least) is because struct type_descriptor is only referenced in
suppressed regions.

Switch the declaration to be a real flexible member.  No functional change.

Fixes: 00fcf4d ("xen/ubsan: Import ubsan implementation from Linux 4.13")
Signed-off-by: Andrew Cooper <[email protected]>
Reviewed-by: Jan Beulich <[email protected]>
Release-Acked-by: Oleksii Kurochko <[email protected]>
  • Loading branch information
andyhhp committed Jun 18, 2024
1 parent 3695589 commit bd59af9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion xen/common/ubsan/ubsan.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ enum {
struct type_descriptor {
u16 type_kind;
u16 type_info;
char type_name[1];
char type_name[];
};

struct source_location {
Expand Down

0 comments on commit bd59af9

Please sign in to comment.