[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen stable-4.17] xen/ubsan: Fix UB in type_descriptor declaration



commit 9dfe294cb6de52c34f1419394fde1fe2b6c2a70b
Author:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
AuthorDate: Wed Jun 26 14:12:38 2024 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Wed Jun 26 14:12:38 2024 +0200

    xen/ubsan: Fix UB in type_descriptor declaration
    
    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: 00fcf4dd8eb4 ("xen/ubsan: Import ubsan implementation from Linux 
4.13")
    Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
    master commit: bd59af99700f075d06a6d47a16f777c9519928e0
    master date: 2024-06-18 14:55:04 +0100
---
 xen/common/ubsan/ubsan.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/common/ubsan/ubsan.h b/xen/common/ubsan/ubsan.h
index a3159040fe..3db42e75b1 100644
--- a/xen/common/ubsan/ubsan.h
+++ b/xen/common/ubsan/ubsan.h
@@ -10,7 +10,7 @@ enum {
 struct type_descriptor {
        u16 type_kind;
        u16 type_info;
-       char type_name[1];
+       char type_name[];
 };
 
 struct source_location {
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.17



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.