Skip to content

Commit

Permalink
baseband/acc100: avoid out-of-bounds access
Browse files Browse the repository at this point in the history
[ upstream commit fb6996e ]

The actual maximum number of gather pointers should have been limited

Coverity issue: 375803, 375813, 375819, 375827, 375831
Fixes: 5ad5060 ("baseband/acc100: add LDPC processing functions")

Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
  • Loading branch information
nicolas-chautru authored and bluca committed Feb 28, 2022
1 parent ced8638 commit dceebf9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/baseband/acc100/rte_acc100_pmd.c
Expand Up @@ -1458,8 +1458,7 @@ acc100_dma_fill_blk_type_in(struct acc100_dma_req_desc *desc,
next_triplet++;

while (cb_len > 0) {
if (next_triplet < ACC100_DMA_MAX_NUM_POINTERS &&
m->next != NULL) {
if (next_triplet < ACC100_DMA_MAX_NUM_POINTERS_IN && m->next != NULL) {

m = m->next;
*seg_total_left = rte_pktmbuf_data_len(m);
Expand Down
1 change: 1 addition & 0 deletions drivers/baseband/acc100/rte_acc100_pmd.h
Expand Up @@ -113,6 +113,7 @@
#define ACC100_SW_RING_MEM_ALLOC_ATTEMPTS 5
#define ACC100_MAX_QUEUE_DEPTH 1024
#define ACC100_DMA_MAX_NUM_POINTERS 14
#define ACC100_DMA_MAX_NUM_POINTERS_IN 7
#define ACC100_DMA_DESC_PADDING 8
#define ACC100_FCW_PADDING 12
#define ACC100_DESC_FCW_OFFSET 192
Expand Down

0 comments on commit dceebf9

Please sign in to comment.