summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2023-06-29 22:09:00 +0300
committerKees Cook <keescook@chromium.org>2023-07-06 00:11:30 +0300
commit01f23c5f1526f5b6ff744887aa511b9e69d4401b (patch)
treea6222e0c36038a3e1c12f848a25ed928e3d7ed78 /lib
parent5e2956ee46244ffba1d345bae8115aa5dc199adc (diff)
downloadlinux-01f23c5f1526f5b6ff744887aa511b9e69d4401b.tar.xz
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 <bp@alien8.de> Closes: https://lore.kernel.org/lkml/2023062945-fencing-pebble-0411@gregkh/ Reported-by: Mirsad Todorovac <mirsad.todorovac@alu.unizg.hr> Closes: https://lore.kernel.org/lkml/9a8e34ad-8a8b-3830-4878-3c2c82e69dd9@alu.unizg.hr/ Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: "Gustavo A. R. Silva" <gustavoars@kernel.org> Tested-by: "Borislav Petkov (AMD)" <bp@alien8.de> Tested-by: Mirsad Todorovac <mirsad.todorovac@alu.unizg.hr> Reviewed-by: "Gustavo A. R. Silva" <gustavoars@kernel.org> Link: https://lore.kernel.org/r/20230629190900.never.787-kees@kernel.org Signed-off-by: Kees Cook <keescook@chromium.org>
Diffstat (limited to 'lib')
0 files changed, 0 insertions, 0 deletions