KSPP / linux

Linux kernel source tree (Kernel Self Protection Project)
https://kernsec.org/wiki/index.php/Kernel_Self_Protection_Project
Other
80 stars 5 forks source link

Fix -Warray-bounds issues in drivers/infiniband/core/user_mad.c #273

Closed GustavoARSilva closed 1 year ago

GustavoARSilva commented 1 year ago

Seen under GCC-13

drivers/infiniband/core/user_mad.c:564:50: warning: array subscript ‘struct ib_rmpp_mad[0]’ is partly outside array bounds of ‘unsigned char[140]’ [-Warray-bounds=]
drivers/infiniband/core/user_mad.c:566:42: warning: array subscript ‘struct ib_rmpp_mad[0]’ is partly outside array bounds of ‘unsigned char[140]’ [-Warray-bounds=]
drivers/infiniband/core/user_mad.c:618:25: warning: array subscript ‘struct ib_rmpp_mad[0]’ is partly outside array bounds of ‘unsigned char[140]’ [-Warray-bounds=]
drivers/infiniband/core/user_mad.c:622:44: warning: array subscript ‘struct ib_rmpp_mad[0]’ is partly outside array bounds of ‘unsigned char[140]’ [-Warray-bounds=]

See: https://godbolt.org/z/oYWaGM4Yb

GustavoARSilva commented 1 year ago

This: https://lore.kernel.org/linux-hardening/ZBo5x5e7B25hHr4F@work/ or that: https://lore.kernel.org/linux-hardening/ZBpB91qQcB10m3Fw@work/