diff options
author | Kees Cook <[email protected]> | 2023-06-29 12:09:00 -0700 |
---|---|---|
committer | Kees Cook <[email protected]> | 2023-07-05 14:11:30 -0700 |
commit | 01f23c5f1526f5b6ff744887aa511b9e69d4401b (patch) | |
tree | a6222e0c36038a3e1c12f848a25ed928e3d7ed78 /lib/test_fortify/write_overflow-strlcpy-src.c | |
parent | 5e2956ee46244ffba1d345bae8115aa5dc199adc (diff) |
usb: ch9: Replace bmSublinkSpeedAttr 1-element array with flexible array
Since commit 2d47c6956ab3 ("ubsan: Tighten UBSAN_BOUNDS on GCC"),
UBSAN_BOUNDS no longer pretends 1-element arrays are unbounded. Walking
bmSublinkSpeedAttr will trigger a warning, so make it a proper flexible
array. Add a union to keep the struct size identical for userspace in
case anything was depending on the old size.
False positive warning was:
UBSAN: array-index-out-of-bounds in drivers/usb/host/xhci-hub.c:231:31 index 1 is out of range for type '__le32 [1]'
for this line of code:
ssp_cap->bmSublinkSpeedAttr[offset++] = cpu_to_le32(attr);
Reported-by: Borislav Petkov <[email protected]>
Closes: https://lore.kernel.org/lkml/2023062945-fencing-pebble-0411@gregkh/
Reported-by: Mirsad Todorovac <[email protected]>
Closes: https://lore.kernel.org/lkml/[email protected]/
Cc: Greg Kroah-Hartman <[email protected]>
Cc: "Gustavo A. R. Silva" <[email protected]>
Tested-by: "Borislav Petkov (AMD)" <[email protected]>
Tested-by: Mirsad Todorovac <[email protected]>
Reviewed-by: "Gustavo A. R. Silva" <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Kees Cook <[email protected]>
Diffstat (limited to 'lib/test_fortify/write_overflow-strlcpy-src.c')
0 files changed, 0 insertions, 0 deletions