Commit ad31c62
octeontx2-af: Fix possible buffer overflow
A loop in rvu_mbox_handler_nix_bandprof_free() contains
a break if (idx == MAX_BANDPROF_PER_PFFUNC),
but if idx may reach MAX_BANDPROF_PER_PFFUNC
buffer '(*req->prof_idx)[layer]' overflow happens before that check.
The patch moves the break to the
beginning of the loop.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Fixes: e8e095b ("octeontx2-af: cn10k: Bandwidth profiles config support").
Signed-off-by: Elena Salomatkina <elena.salomatkina.cmc@gmail.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Reviewed-by: Subbaraya Sundeep <sbhatta@marvell.com>
Link: https://lore.kernel.org/r/20231124210802.109763-1-elena.salomatkina.cmc@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>1 parent ec2610b commit ad31c62
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5505 | 5505 | | |
5506 | 5506 | | |
5507 | 5507 | | |
| 5508 | + | |
| 5509 | + | |
5508 | 5510 | | |
5509 | 5511 | | |
5510 | 5512 | | |
| |||
5518 | 5520 | | |
5519 | 5521 | | |
5520 | 5522 | | |
5521 | | - | |
5522 | | - | |
5523 | 5523 | | |
5524 | 5524 | | |
5525 | 5525 | | |
| |||
0 commit comments