diff options
author | Javier Carrasco <[email protected]> | 2024-06-19 21:42:44 +0200 |
---|---|---|
committer | Johan Hovold <[email protected]> | 2024-07-05 14:00:11 +0200 |
commit | 55a15b3a713a3f24360cf9d8dcfd2a3e337321d6 (patch) | |
tree | 6ac944ff34fc9ee11b06808fd4478e4499e09f86 | |
parent | 9f4dc05107a6db3743e6b9ea4014cbdc3795682d (diff) |
USB: serial: garmin_gps: annotate struct garmin_packet with __counted_by
Use the __counted_by compiler attribute for the data[] flexible array
member to improve the results of array bound sanitizers.
Reviewed-by: Nathan Chancellor <[email protected]>
Signed-off-by: Javier Carrasco <[email protected]>
Reviewed-by: Gustavo A. R. Silva <[email protected]>
Reviewed-by: Kees Cook <[email protected]>
Signed-off-by: Johan Hovold <[email protected]>
-rw-r--r-- | drivers/usb/serial/garmin_gps.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/serial/garmin_gps.c b/drivers/usb/serial/garmin_gps.c index 670e942fdaaa..57df6ad183ff 100644 --- a/drivers/usb/serial/garmin_gps.c +++ b/drivers/usb/serial/garmin_gps.c @@ -104,7 +104,7 @@ struct garmin_packet { int seq; /* the real size of the data array, always > 0 */ int size; - __u8 data[]; + __u8 data[] __counted_by(size); }; /* structure used to keep the current state of the driver */ |