opnsense-src/sys/dev/cxgbe
John Baldwin b483b6b256 cxgbe tom: Force unsigned modulus for queue indices.
The final transmit and receive queue indices need to be positive
values.  However, since txq_idx and rxq_idx are signed (to permit
using -1 to as a marker for uninitialized values), using %= with
another integer type (vi->nofld[tr]xq) yielded a sign-extended modulus
value.  This resulted in negative queue indices and a buffer underrun
when arc4random() returned a value with the sign bit set.  Use a
temporary unsigned variable to hold the "raw" queue index to force
unsigned modulus.

This worked previously because the modulus was previously applied
directly to the return value of arc4random() which is unsigned before
the result was assigned to txq_idx and rxq_idx.

Discussed with:	np
Fixes:		db28d4a0cd cxgbe/t4_tom: Support for round-robin selection of offload queues.
Sponsored by:	Chelsio Communications
2022-05-05 16:30:14 -07:00
..
common cxgbe(4): Handle FORCE_FEC in pcaps correctly. 2022-03-25 00:39:00 -07:00
crypto cxgbe(4): Fix bad races between sysctl and driver detach. 2022-01-14 16:44:57 -08:00
cudbg cxgbe(4): Fix a typo in a source code comment 2022-04-02 15:19:59 +02:00
cxgbei cxgbei: Return limits for the specific adapter the socket is on. 2022-04-18 12:53:33 -07:00
firmware cxgbe(4): Update firmwares to 1.26.6.0. 2022-01-03 15:24:42 -08:00
iw_cxgbe cxgbe(4): Fix a typo in a source code comment 2022-04-09 09:26:17 +02:00
tom cxgbe tom: Force unsigned modulus for queue indices. 2022-05-05 16:30:14 -07:00
adapter.h cxgbe/t4_tom: Support for round-robin selection of offload queues. 2022-04-14 15:49:58 -07:00
if_cc.c cxgbe(4): Attach to cards with the Terminator 6 ASIC. T6 cards will 2016-09-16 00:08:37 +00:00
if_ccv.c cxgbe(4): Attach to cards with the Terminator 6 ASIC. T6 cards will 2016-09-16 00:08:37 +00:00
if_cxl.c cxgbe(4): Add a minimal if_cxl module that pulls in the real driver as 2015-02-06 01:10:04 +00:00
if_cxlv.c Chelsio T4/T5 VF driver. 2016-09-07 18:13:57 +00:00
offload.h cxgbei: Support for ISO (iSCSI segmentation offload). 2021-08-06 14:21:37 -07:00
osdep.h cxgbe(4): make the logging helpers a little more robust. 2021-04-22 15:28:43 -07:00
t4_clip.c cxgbe(4): Empty the clib_db before trying to destroy it. 2021-06-04 12:01:14 -07:00
t4_clip.h cxgbe(4): Overhaul CLIP (Compressed Local IPv6) table management. 2021-05-23 16:07:29 -07:00
t4_filter.c cxgbe(4): Add support for NIC suspend/resume and live reset. 2021-04-27 22:48:51 -07:00
t4_if.m Use the port device name for the iov device for Chelsio T4/T5 cards. 2016-08-03 17:11:08 +00:00
t4_ioctl.h cxgbe/t4_tom: Support for round-robin selection of offload queues. 2022-04-14 15:49:58 -07:00
t4_iov.c cxgbe: Remove unused devclass arguments to *DRIVER_MODULE(). 2022-04-19 10:44:08 -07:00
t4_l2t.c NIC KTLS for Chelsio T6 adapters. 2019-11-21 19:30:31 +00:00
t4_l2t.h NIC KTLS for Chelsio T6 adapters. 2019-11-21 19:30:31 +00:00
t4_main.c cxgbe: Remove unused devclass arguments to *DRIVER_MODULE(). 2022-04-19 10:44:08 -07:00
t4_mp_ring.c cxgbe(4): changes in the Tx path to help increase tx coalescing. 2020-07-03 04:44:23 +00:00
t4_mp_ring.h cxgbe(4): changes in the Tx path to help increase tx coalescing. 2020-07-03 04:44:23 +00:00
t4_netmap.c cxgbe(4): Separate the sw- and hw-specific parts of resource allocations 2021-04-26 14:09:59 -07:00
t4_sched.c Add a switch structure for send tags. 2021-09-14 11:43:41 -07:00
t4_sge.c cxgbe(4): Changes to the fatal error handler. 2022-02-18 09:16:14 -08:00
t4_smt.c cxgbe(4): Move all control queues to the adapter. 2018-08-11 21:10:08 +00:00
t4_smt.h cxgbe(4): Retire an old check. 2018-06-01 01:05:34 +00:00
t4_tracer.c cxgbe(4): Add support for NIC suspend/resume and live reset. 2021-04-27 22:48:51 -07:00
t4_vf.c cxgbe: Remove unused devclass arguments to *DRIVER_MODULE(). 2022-04-19 10:44:08 -07:00