]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
isofs: Annotate struct SL_component with __counted_by()
authorThorsten Blum <thorsten.blum@toblux.com>
Fri, 30 Aug 2024 16:49:03 +0000 (18:49 +0200)
committerJan Kara <jack@suse.cz>
Mon, 2 Sep 2024 13:52:56 +0000 (15:52 +0200)
Add the __counted_by compiler attribute to the flexible array member
text to improve access bounds-checking via CONFIG_UBSAN_BOUNDS and
CONFIG_FORTIFY_SOURCE.

Signed-off-by: Thorsten Blum <thorsten.blum@toblux.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Link: https://patch.msgid.link/20240830164902.112682-2-thorsten.blum@toblux.com
fs/isofs/rock.h

index ee9660e9671cbc403a5f1e25439b298a10d1915b..7755e587f77850caee00e16c4d807452b9e8dd32 100644 (file)
@@ -44,7 +44,7 @@ struct RR_PN_s {
 struct SL_component {
        __u8 flags;
        __u8 len;
-       __u8 text[];
+       __u8 text[] __counted_by(len);
 } __attribute__ ((packed));
 
 struct RR_SL_s {