diff options
| author | Selvin Xavier <selvin.xavier@broadcom.com> | 2026-09-21 23:12:29 -0700 |
|---|---|---|
| committer | Leon Romanovsky <leon@kernel.org> | 2026-09-29 04:42:14 -0400 |
| commit | aa6c2ef821a6ba7f3fd58cfcc031b2d16f3811c6 (patch) | |
| tree | 175ac85742190341c4f05087c99aaf8dd9c40180 /tools/lib/python/kdoc/python_version.py | |
| parent | 81caf9240dfb082c0eb2b24feef8266268fd152f (diff) | |
RDMA/bnxt_re: Fix the PD and DPI table size
The PD and DPI bitmaps were sized as max >> 3 (bytes),
but bitmap ops (set_bit(), clear_bit(), find_first_bit(),
test_and_set_bit()) operate on whole unsigned long words,
so whenever max isn't a multiple of BITS_PER_LONG,
the buffer under-allocates and the top word's bitops
read/write past the end of the kmalloc()'d buffer.
Most exposed on the DPI table, since dpit->max comes from the
firmware-reported dev_attr->max_dpi with no alignment guarantee.
Fix the size of both allocations with
BITS_TO_LONGS(max) * sizeof(unsigned long).
Fixes: 1ac5a4047975 ("RDMA/bnxt_re: Add bnxt_re RoCE driver")
Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Diffstat (limited to 'tools/lib/python/kdoc/python_version.py')
0 files changed, 0 insertions, 0 deletions
