From: Thorsten Blum Date: Fri, 30 Aug 2024 16:49:03 +0000 (+0200) Subject: isofs: Annotate struct SL_component with __counted_by() X-Git-Tag: v6.12-rc1~100^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=116249b12939a8ec13eb50f36b6fffd1c719a9ed;p=thirdparty%2Fkernel%2Flinux.git isofs: Annotate struct SL_component with __counted_by() 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 Signed-off-by: Jan Kara Link: https://patch.msgid.link/20240830164902.112682-2-thorsten.blum@toblux.com --- diff --git a/fs/isofs/rock.h b/fs/isofs/rock.h index ee9660e9671cb..7755e587f7785 100644 --- a/fs/isofs/rock.h +++ b/fs/isofs/rock.h @@ -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 {