[PATCH v3 00/10] codeql fixes for various subsystems

2023-01-19 Thread okaya
From: Sinan Kaya Following up the codeql reported problems first submitted by Stephen Hemminger here: https://lore.kernel.org/all/20220527161210.77212d0b@hermes.local/t/ Posting a series of fixes about potential null pointer accesses. Changes from v3: - Dropped net/tap: check if name is null -

[PATCH v3 02/10] memzone: check result of rte_fbarray_get

2023-01-19 Thread okaya
From: Sinan Kaya In memzone_lookup_thread_unsafe result of call to rte_fbarray_get is dereferenced here and may be null. Signed-off-by: Sinan Kaya --- lib/eal/common/eal_common_memzone.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/eal/common/eal_common_memzone.

[PATCH v3 01/10] ethdev: check return result of rte_eth_dev_info_get

2023-01-19 Thread okaya
From: Sinan Kaya rte_class_eth: eth_mac_cmp: The status of this call to rte_eth_dev_info_get is not checked, potentially leaving dev_info uninitialized. Signed-off-by: Sinan Kaya --- lib/ethdev/rte_class_eth.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/ethdev/rt

[PATCH v3 03/10] memzone: check result of malloc_elem_from_data

2023-01-19 Thread okaya
From: Sinan Kaya In memzone_reserve_aligned_thread_unsafe result of call to malloc_elem_from_data is dereferenced here and may be null. Signed-off-by: Sinan Kaya --- lib/eal/common/eal_common_memzone.c | 4 1 file changed, 4 insertions(+) diff --git a/lib/eal/common/eal_common_memzone.c

[PATCH v3 04/10] malloc: malloc_elem_join_adjacent_free can return null

2023-01-19 Thread okaya
From: Sinan Kaya In malloc_heap_add_memory result of call to malloc_elem_join_adjacent_free is dereferenced here and may be null. Signed-off-by: Sinan Kaya --- lib/eal/common/malloc_heap.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/eal/common/malloc_heap.c b/lib/eal/common/mallo

[PATCH v3 05/10] malloc: check result of rte_mem_virt2memseg_list

2023-01-19 Thread okaya
From: Sinan Kaya In alloc_pages_on_heap result of call to rte_mem_virt2memseg_list is dereferenced here and may be null. Signed-off-by: Sinan Kaya --- lib/eal/common/malloc_heap.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/eal/common/malloc_heap.c b/lib/eal/common/malloc_heap.c

[PATCH v3 06/10] malloc: check result of rte_fbarray_get

2023-01-19 Thread okaya
From: Sinan Kaya In eal_memalloc_is_contig result of call to rte_fbarray_get is dereferenced here and may be null. Signed-off-by: Sinan Kaya --- lib/eal/common/eal_common_memalloc.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/eal/common/eal_common_memalloc.c b/

[PATCH v3 07/10] malloc: check result of rte_mem_virt2memseg

2023-01-19 Thread okaya
From: Sinan Kaya In malloc_elem_find_max_iova_contig result of call to rte_mem_virt2memseg is dereferenced here and may be null. Signed-off-by: Sinan Kaya --- lib/eal/common/malloc_elem.c | 11 --- lib/eal/common/malloc_heap.c | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-)

[PATCH v3 08/10] malloc: check result of malloc_elem_free

2023-01-19 Thread okaya
From: Sinan Kaya In malloc_heap_free result of call to malloc_elem_free is dereferenced here and may be null. Signed-off-by: Sinan Kaya --- lib/eal/common/malloc_heap.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/eal/common/malloc_heap.c b/lib/eal/common/malloc_heap.c index 8827

[PATCH v3 09/10] malloc: check result of elem_start_pt

2023-01-19 Thread okaya
From: Sinan Kaya In malloc_elem_alloc result of call to elem_start_pt is dereferenced here and may be null. Signed-off-by: Sinan Kaya --- lib/eal/common/malloc_elem.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/eal/common/malloc_elem.c b/lib/eal/common/malloc_elem.c index 8f4981

[PATCH v3 10/10] bus/vdev: check result of rte_vdev_device_name

2023-01-19 Thread okaya
From: Sinan Kaya In rte_eth_vdev_allocate result of call to rte_vdev_device_name is dereferenced here and may be null. Signed-off-by: Sinan Kaya --- lib/ethdev/ethdev_vdev.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ethdev/ethdev_vdev.h b/lib/ethdev/ethdev_vdev.h index 364f140f

[PATCH] testpmd: unregister event callback

2023-09-14 Thread okaya
From: Sinan Kaya Cleanup event registry during shutdown to prevent memory leaks. Signed-off-by: Sinan Kaya --- app/test-pmd/testpmd.c | 27 +++ 1 file changed, 27 insertions(+) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index c6ad9b18bf..1de7b7cd51 10

[PATCH v1 0/7] support reinit flow

2023-08-14 Thread okaya
From: Sinan Kaya We want to be able to call rte_eal_init() and rte_eal_cleanup() APIs back to back for maintanance reasons. Here is a summary of the code we have seen so far: 1. some code support getting called multiple times by keeping a static variable. 2. some code initializes once but never

[PATCH v1 1/7] eal: fixes for re-initialization issues

2023-08-14 Thread okaya
From: Graham Whyte reinitialize the solib link list and clean the globals holding state for parsing. Signed-off-by: Sinan Kaya Signed-off by: Graham Whyte --- lib/eal/common/eal_common_options.c | 7 +++ lib/eal/linux/eal.c | 4 +++- 2 files changed, 10 insertions(+), 1 de

[PATCH v1 2/7] tailq: skip init if already initialized

2023-08-14 Thread okaya
From: Sinan Kaya Allows tailq to be reinitialied multiple times by looking up previously registered tailqs Signed-off-by: Sinan Kaya --- lib/eal/common/eal_common_tailqs.c | 21 ++--- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/lib/eal/common/eal_common_tailq

[PATCH v1 3/7] eal_memzone: bail out on initialized

2023-08-14 Thread okaya
From: Sinan Kaya Initialize memzone once and bail out if someone calls init multiple times. Signed-off-by: Sinan Kaya --- lib/eal/common/eal_common_memzone.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/lib/eal/common/eal_common_memzone.c b/lib/eal/common/eal_common_memzone.c ind

[PATCH v1 4/7] memseg: init once

2023-08-14 Thread okaya
From: Sinan Kaya Initialize memory segments just once and bail out if called multiple times. Signed-off-by: Sinan Kaya --- lib/eal/linux/eal_memory.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/eal/linux/eal_memory.c b/lib/eal/linux/eal_memory.c index 60

[PATCH v1 5/7] eal_memory: skip initialization

2023-08-14 Thread okaya
From: Sinan Kaya Initialize heap area just once. Signed-off-by: Sinan Kaya --- lib/eal/common/eal_common_memory.c | 5 + lib/eal/common/malloc_heap.c | 6 ++ 2 files changed, 11 insertions(+) diff --git a/lib/eal/common/eal_common_memory.c b/lib/eal/common/eal_common_memory.c i

[PATCH v1 6/7] eal_interrupts: don't reinitialize threads

2023-08-14 Thread okaya
From: Sinan Kaya Signed-off-by: Sinan Kaya --- lib/eal/linux/eal_interrupts.c | 5 + 1 file changed, 5 insertions(+) diff --git a/lib/eal/linux/eal_interrupts.c b/lib/eal/linux/eal_interrupts.c index d52ec8eb4c..aa296f153b 100644 --- a/lib/eal/linux/eal_interrupts.c +++ b/lib/eal/linux/eal

[PATCH v1 7/7] eal: initialize worker threads once

2023-08-14 Thread okaya
From: Sinan Kaya Signed-off-by: Sinan Kaya --- lib/eal/linux/eal.c | 68 - 1 file changed, 36 insertions(+), 32 deletions(-) diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c index 5fd81d71cb..63190a4e70 100644 --- a/lib/eal/linux/eal.c +++ b/li

[PATCH v2 0/7] support reinit flow

2023-08-14 Thread okaya
From: Sinan Kaya We want to be able to call rte_eal_init() and rte_eal_cleanup() APIs back to back for maintanance reasons. Here is a summary of the code we have seen so far: 1. some code support getting called multiple times by keeping a static variable. 2. some code initializes once but never

[PATCH v2 1/7] eal: fixes for re-initialization issues

2023-08-14 Thread okaya
From: Graham Whyte reinitialize the solib link list and clean the globals holding state for parsing. Signed-off-by: Sinan Kaya Signed-off-by: Graham Whyte --- lib/eal/common/eal_common_options.c | 7 +++ lib/eal/linux/eal.c | 4 +++- 2 files changed, 10 insertions(+), 1 de

[PATCH v2 2/7] tailq: skip init if already initialized

2023-08-14 Thread okaya
From: Sinan Kaya Allows tailq to be reinitialied multiple times by looking up previously registered tailqs Signed-off-by: Sinan Kaya --- lib/eal/common/eal_common_tailqs.c | 20 +--- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/lib/eal/common/eal_common_tailqs

[PATCH v2 3/7] eal_memzone: bail out on initialized

2023-08-14 Thread okaya
From: Sinan Kaya Initialize memzone once and bail out if someone calls init multiple times. Signed-off-by: Sinan Kaya --- lib/eal/common/eal_common_memzone.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/lib/eal/common/eal_common_memzone.c b/lib/eal/common/eal_common_memzone.c in

[PATCH v2 5/7] eal_memory: skip initialization

2023-08-14 Thread okaya
From: Sinan Kaya Initialize heap area just once. Signed-off-by: Sinan Kaya --- lib/eal/common/eal_common_memory.c | 5 + lib/eal/common/malloc_heap.c | 7 +++ 2 files changed, 12 insertions(+) diff --git a/lib/eal/common/eal_common_memory.c b/lib/eal/common/eal_common_memory.c

[PATCH v2 4/7] memseg: init once

2023-08-14 Thread okaya
From: Sinan Kaya Initialize memory segments just once and bail out if called multiple times. Signed-off-by: Sinan Kaya --- lib/eal/linux/eal_memory.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/eal/linux/eal_memory.c b/lib/eal/linux/eal_memory.c index 6

[PATCH v2 6/7] eal_interrupts: don't reinitialize threads

2023-08-14 Thread okaya
From: Sinan Kaya Initialize interrupt thread once and keep a flag for further init. Signed-off-by: Sinan Kaya --- lib/eal/linux/eal_interrupts.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/lib/eal/linux/eal_interrupts.c b/lib/eal/linux/eal_interrupts.c index d52ec8eb4c..f141711f

[PATCH v2 7/7] eal: initialize worker threads once

2023-08-14 Thread okaya
From: Sinan Kaya Initialize worker threads once and keep a flag for other init calls. Signed-off-by: Sinan Kaya --- lib/eal/linux/eal.c | 68 - 1 file changed, 36 insertions(+), 32 deletions(-) diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c

[PATCH v3 0/7] support reinit flow

2023-08-14 Thread okaya
From: Sinan Kaya We want to be able to call rte_eal_init() and rte_eal_cleanup() APIs back to back for maintanance reasons. Here is a summary of the code we have seen so far: 1. some code support getting called multiple times by keeping a static variable. 2. some code initializes once but never

[PATCH v3 1/7] eal: fixes for re-initialization issues

2023-08-14 Thread okaya
From: Graham Whyte reinitialize the solib link list and clean the globals holding state for parsing. Signed-off-by: Sinan Kaya Signed-off-by: Graham Whyte --- lib/eal/common/eal_common_options.c | 7 +++ lib/eal/linux/eal.c | 4 +++- 2 files changed, 10 insertions(+), 1 de

[PATCH v3 2/7] tailq: skip init if already initialized

2023-08-14 Thread okaya
From: Sinan Kaya Allows tailq to be reinitialied multiple times by looking up previously registered tailqs Signed-off-by: Sinan Kaya --- lib/eal/common/eal_common_tailqs.c | 20 +--- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/lib/eal/common/eal_common_tailqs

[PATCH v3 3/7] eal_memzone: bail out on initialized

2023-08-14 Thread okaya
From: Sinan Kaya Initialize memzone once and bail out if someone calls init multiple times. Signed-off-by: Sinan Kaya --- lib/eal/common/eal_common_memzone.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/lib/eal/common/eal_common_memzone.c b/lib/eal/common/eal_common_memzone.c in

[PATCH v3 4/7] memseg: init once

2023-08-14 Thread okaya
From: Sinan Kaya Initialize memory segments just once and bail out if called multiple times. Signed-off-by: Sinan Kaya --- lib/eal/linux/eal_memory.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/eal/linux/eal_memory.c b/lib/eal/linux/eal_memory.c index 9

[PATCH v3 5/7] eal_memory: skip initialization

2023-08-14 Thread okaya
From: Sinan Kaya Initialize heap area just once. Signed-off-by: Sinan Kaya --- lib/eal/common/eal_common_memory.c | 5 + lib/eal/common/malloc_heap.c | 7 +++ 2 files changed, 12 insertions(+) diff --git a/lib/eal/common/eal_common_memory.c b/lib/eal/common/eal_common_memory.c

[PATCH v3 6/7] eal_interrupts: don't reinitialize threads

2023-08-14 Thread okaya
From: Sinan Kaya Initialize interrupt thread once and keep a flag for further init. Signed-off-by: Sinan Kaya --- lib/eal/linux/eal_interrupts.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/lib/eal/linux/eal_interrupts.c b/lib/eal/linux/eal_interrupts.c index c9881143be..6a35b4ae

[PATCH v3 7/7] eal: initialize worker threads once

2023-08-14 Thread okaya
From: Sinan Kaya Initialize worker threads once and keep a flag for other init calls. Signed-off-by: Sinan Kaya --- lib/eal/linux/eal.c | 60 - 1 file changed, 32 insertions(+), 28 deletions(-) diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c

[PATCH v4 0/8] support reinit flow

2023-08-15 Thread okaya
From: Sinan Kaya We want to be able to call rte_eal_init() and rte_eal_cleanup() APIs back to back for maintanance reasons. Here is a summary of the code we have seen so far: 1. some code support getting called multiple times by keeping a static variable. 2. some code initializes once but never

[PATCH v4 1/8] eal: cleanup plugins data

2023-08-15 Thread okaya
From: Stephen Hemminger When rte_eal_cleanup is called walk through the list of shared objects loaded, and close them and free the data structure. Signed-off-by: Stephen Hemminger Signed-off-by: Sinan Kaya --- lib/eal/common/eal_common_options.c | 12 lib/eal/common/eal_options.h

[PATCH v4 2/8] eal: fixes for re-initialization issues

2023-08-15 Thread okaya
From: Graham Whyte reinitialize the solib link list and clean the globals holding state for parsing. Signed-off-by: Sinan Kaya Signed-off-by: Graham Whyte --- lib/eal/common/eal_common_options.c | 8 lib/eal/linux/eal.c | 4 +++- 2 files changed, 11 insertions(+), 1 d

[PATCH v4 3/8] tailq: skip init if already initialized

2023-08-15 Thread okaya
From: Sinan Kaya Allows tailq to be reinitialied multiple times by looking up previously registered tailqs Signed-off-by: Sinan Kaya --- lib/eal/common/eal_common_tailqs.c | 20 +--- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/lib/eal/common/eal_common_tailqs

[PATCH v4 4/8] eal_memzone: bail out on initialized

2023-08-15 Thread okaya
From: Sinan Kaya Initialize memzone once and bail out if someone calls init multiple times. Signed-off-by: Sinan Kaya --- lib/eal/common/eal_common_memzone.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/lib/eal/common/eal_common_memzone.c b/lib/eal/common/eal_common_memzone.c in

[PATCH v4 5/8] memseg: init once

2023-08-15 Thread okaya
From: Sinan Kaya Initialize memory segments just once and bail out if called multiple times. Signed-off-by: Sinan Kaya --- lib/eal/linux/eal_memory.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/eal/linux/eal_memory.c b/lib/eal/linux/eal_memory.c index 9

[PATCH v4 6/8] eal_memory: skip initialization

2023-08-15 Thread okaya
From: Sinan Kaya Initialize heap area just once. Signed-off-by: Sinan Kaya --- lib/eal/common/eal_common_memory.c | 5 + lib/eal/common/malloc_heap.c | 7 +++ 2 files changed, 12 insertions(+) diff --git a/lib/eal/common/eal_common_memory.c b/lib/eal/common/eal_common_memory.c

[PATCH v4 7/8] eal_interrupts: don't reinitialize threads

2023-08-15 Thread okaya
From: Sinan Kaya Initialize interrupt thread once and keep a flag for further init. Signed-off-by: Sinan Kaya --- lib/eal/linux/eal_interrupts.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/lib/eal/linux/eal_interrupts.c b/lib/eal/linux/eal_interrupts.c index c9881143be..6a35b4ae

[PATCH v4 8/8] eal: initialize worker threads once

2023-08-15 Thread okaya
From: Sinan Kaya Initialize worker threads once and keep a flag for other init calls. Signed-off-by: Sinan Kaya --- lib/eal/linux/eal.c | 60 - 1 file changed, 32 insertions(+), 28 deletions(-) diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c

[PATCH v5 00/10] support reinit flow

2023-08-16 Thread okaya
From: Sinan Kaya We want to be able to call rte_eal_init() and rte_eal_cleanup() APIs back to back for maintanance reasons. Here is a summary of the code we have seen so far: 1. some code support getting called multiple times by keeping a static variable. 2. some code initializes once but never

[PATCH v5 01/10] eal: cleanup plugins data

2023-08-16 Thread okaya
From: Stephen Hemminger When rte_eal_cleanup is called walk through the list of shared objects loaded, and close them and free the data structure. Signed-off-by: Stephen Hemminger Signed-off-by: Sinan Kaya --- lib/eal/common/eal_common_options.c | 14 ++ lib/eal/common/eal_options

[PATCH v5 02/10] eal: fixes for re-initialization issues

2023-08-16 Thread okaya
From: Graham Whyte reinitialize the solib link list and clean the globals holding state for parsing. Signed-off-by: Sinan Kaya Signed-off-by: Graham Whyte --- lib/eal/common/eal_common_options.c | 7 +++ lib/eal/linux/eal.c | 4 +++- 2 files changed, 10 insertions(+), 1 de

[PATCH v5 03/10] tailq: skip init if already initialized

2023-08-16 Thread okaya
From: Sinan Kaya Allows tailq to be reinitialied multiple times by looking up previously registered tailqs Signed-off-by: Sinan Kaya --- lib/eal/common/eal_common_tailqs.c | 20 +--- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/lib/eal/common/eal_common_tailqs

[PATCH v5 04/10] eal_memzone: bail out on initialized

2023-08-16 Thread okaya
From: Sinan Kaya Initialize memzone once and bail out if someone calls init multiple times. Signed-off-by: Sinan Kaya --- lib/eal/common/eal_common_memzone.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/lib/eal/common/eal_common_memzone.c b/lib/eal/common/eal_common_memzone.c ind

[PATCH v5 05/10] memseg: init once

2023-08-16 Thread okaya
From: Sinan Kaya Initialize memory segments just once and bail out if called multiple times. Signed-off-by: Sinan Kaya --- lib/eal/linux/eal_memory.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/eal/linux/eal_memory.c b/lib/eal/linux/eal_memory.c index 9

[PATCH v5 06/10] eal_memory: skip initialization

2023-08-16 Thread okaya
From: Sinan Kaya Initialize heap area just once. Signed-off-by: Sinan Kaya --- lib/eal/common/eal_common_memory.c | 6 ++ lib/eal/common/malloc_heap.c | 7 +++ 2 files changed, 13 insertions(+) diff --git a/lib/eal/common/eal_common_memory.c b/lib/eal/common/eal_common_memory.c

[PATCH v5 07/10] eal_interrupts: don't reinitialize threads

2023-08-16 Thread okaya
From: Sinan Kaya Initialize interrupt thread once and keep a flag for further init. Signed-off-by: Sinan Kaya --- lib/eal/linux/eal_interrupts.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/lib/eal/linux/eal_interrupts.c b/lib/eal/linux/eal_interrupts.c index c9881143be..7adf4076a

[PATCH v5 08/10] eal: initialize worker threads once

2023-08-16 Thread okaya
From: Sinan Kaya Initialize worker threads once and keep a flag for other init calls. Signed-off-by: Sinan Kaya --- lib/eal/linux/eal.c | 60 - 1 file changed, 32 insertions(+), 28 deletions(-) diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c

[PATCH v5 09/10] eal: declare the reinit via cleanup/init feature unsupported

2023-08-16 Thread okaya
From: Sinan Kaya Call of rte_eal_init() api after rte_eal_cleanup() possible for certain application types but this is not an officially supported feature. Signed-off-by: Sinan Kaya --- lib/eal/include/rte_eal.h | 5 + 1 file changed, 5 insertions(+) diff --git a/lib/eal/include/rte_eal.h

[PATCH v5 10/10] test: remove double registration check

2023-08-16 Thread okaya
From: Sinan Kaya Code will fetch the existing registration when called for second time as part of the reinit changes. Registration will still succeed. Signed-off-by: Sinan Kaya --- app/test/test_tailq.c | 5 - 1 file changed, 5 deletions(-) diff --git a/app/test/test_tailq.c b/app/test/te

[PATCH 01/11] ethdev: check return result of rte_eth_dev_info_get

2022-11-21 Thread okaya
From: Sinan Kaya rte_class_eth: eth_mac_cmp: The status of this call to rte_eth_dev_info_get is not checked, potentially leaving dev_info uninitialized. Signed-off-by: Sinan Kaya --- lib/ethdev/rte_class_eth.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/ethdev/rt

[PATCH 00/11] codeql fixes for various subsystems

2022-11-21 Thread okaya
From: Sinan Kaya Following up the codeql reported problems first submitted by Stephen Hemminger here: https://lore.kernel.org/all/20220527161210.77212d0b@hermes.local/t/ Posting a series of fixes about potential null pointer accesses. Sinan Kaya (11): ethdev: check return result of rte_eth_d

[PATCH 04/11] memzone: check result of malloc_elem_from_data

2022-11-21 Thread okaya
From: Sinan Kaya In memzone_reserve_aligned_thread_unsafe result of call to malloc_elem_from_data is dereferenced here and may be null. Signed-off-by: Sinan Kaya --- lib/eal/common/eal_common_memzone.c | 4 1 file changed, 4 insertions(+) diff --git a/lib/eal/common/eal_common_memzone.c

[PATCH 02/11] net/tap: check if name is null

2022-11-21 Thread okaya
From: Sinan Kaya In rte_pmd_tun_probe result of call to rte_vdev_device_name is dereferenced here and may be null. Signed-off-by: Sinan Kaya --- drivers/net/tap/rte_eth_tap.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c i

[PATCH 05/11] malloc: malloc_elem_join_adjacent_free can return null

2022-11-21 Thread okaya
From: Sinan Kaya In malloc_heap_add_memory result of call to malloc_elem_join_adjacent_free is dereferenced here and may be null. Signed-off-by: Sinan Kaya --- lib/eal/common/malloc_heap.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/eal/common/malloc_heap.c b/lib/eal/common/mall

[PATCH 06/11] malloc: check result of rte_mem_virt2memseg_list

2022-11-21 Thread okaya
From: Sinan Kaya In alloc_pages_on_heap result of call to rte_mem_virt2memseg_list is dereferenced here and may be null. Signed-off-by: Sinan Kaya --- lib/eal/common/malloc_heap.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/eal/common/malloc_heap.c b/lib/eal/common/malloc_heap.c

[PATCH 03/11] memzone: check result of rte_fbarray_get

2022-11-21 Thread okaya
From: Sinan Kaya In memzone_lookup_thread_unsafe result of call to rte_fbarray_get is dereferenced here and may be null. Signed-off-by: Sinan Kaya --- lib/eal/common/eal_common_memzone.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/eal/common/eal_common_memzone.

[PATCH 08/11] malloc: check result of rte_mem_virt2memseg

2022-11-21 Thread okaya
From: Sinan Kaya In malloc_elem_find_max_iova_contig result of call to rte_mem_virt2memseg is dereferenced here and may be null. Signed-off-by: Sinan Kaya --- lib/eal/common/malloc_elem.c | 11 --- lib/eal/common/malloc_heap.c | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-)

[PATCH 07/11] malloc: check result of rte_fbarray_get

2022-11-21 Thread okaya
From: Sinan Kaya In eal_memalloc_is_contig result of call to rte_fbarray_get is dereferenced here and may be null. Signed-off-by: Sinan Kaya --- lib/eal/common/eal_common_memalloc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/eal/common/eal_common_memalloc.c b/l

[PATCH 09/11] malloc: check result of malloc_elem_free

2022-11-21 Thread okaya
From: Sinan Kaya In malloc_heap_free result of call to malloc_elem_free is dereferenced here and may be null. Signed-off-by: Sinan Kaya --- lib/eal/common/malloc_heap.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/eal/common/malloc_heap.c b/lib/eal/common/malloc_heap.c index 1bf2

[PATCH v2 00/11] codeql fixes for various subsystems

2022-11-21 Thread okaya
From: Sinan Kaya Following up the codeql reported problems first submitted by Stephen Hemminger here: https://lore.kernel.org/all/20220527161210.77212d0b@hermes.local/t/ Posting a series of fixes about potential null pointer accesses. Changes from v1: - Remove braces around single line stateme

[PATCH v2 01/11] ethdev: check return result of rte_eth_dev_info_get

2022-11-21 Thread okaya
From: Sinan Kaya rte_class_eth: eth_mac_cmp: The status of this call to rte_eth_dev_info_get is not checked, potentially leaving dev_info uninitialized. Signed-off-by: Sinan Kaya --- lib/ethdev/rte_class_eth.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/ethdev/rt

[PATCH v2 02/11] net/tap: check if name is null

2022-11-21 Thread okaya
From: Sinan Kaya In rte_pmd_tun_probe result of call to rte_vdev_device_name is dereferenced here and may be null. Signed-off-by: Sinan Kaya --- drivers/net/tap/rte_eth_tap.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c in

[PATCH v2 03/11] memzone: check result of rte_fbarray_get

2022-11-21 Thread okaya
From: Sinan Kaya In memzone_lookup_thread_unsafe result of call to rte_fbarray_get is dereferenced here and may be null. Signed-off-by: Sinan Kaya --- lib/eal/common/eal_common_memzone.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/eal/common/eal_common_memzone.

[PATCH v2 04/11] memzone: check result of malloc_elem_from_data

2022-11-21 Thread okaya
From: Sinan Kaya In memzone_reserve_aligned_thread_unsafe result of call to malloc_elem_from_data is dereferenced here and may be null. Signed-off-by: Sinan Kaya --- lib/eal/common/eal_common_memzone.c | 4 1 file changed, 4 insertions(+) diff --git a/lib/eal/common/eal_common_memzone.c

[PATCH v2 05/11] malloc: malloc_elem_join_adjacent_free can return null

2022-11-21 Thread okaya
From: Sinan Kaya In malloc_heap_add_memory result of call to malloc_elem_join_adjacent_free is dereferenced here and may be null. Signed-off-by: Sinan Kaya --- lib/eal/common/malloc_heap.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/eal/common/malloc_heap.c b/lib/eal/common/mallo

[PATCH v2 06/11] malloc: check result of rte_mem_virt2memseg_list

2022-11-21 Thread okaya
From: Sinan Kaya In alloc_pages_on_heap result of call to rte_mem_virt2memseg_list is dereferenced here and may be null. Signed-off-by: Sinan Kaya --- lib/eal/common/malloc_heap.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/eal/common/malloc_heap.c b/lib/eal/common/malloc_heap.c

[PATCH v2 07/11] malloc: check result of rte_fbarray_get

2022-11-21 Thread okaya
From: Sinan Kaya In eal_memalloc_is_contig result of call to rte_fbarray_get is dereferenced here and may be null. Signed-off-by: Sinan Kaya --- lib/eal/common/eal_common_memalloc.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/eal/common/eal_common_memalloc.c b/

[PATCH v2 08/11] malloc: check result of rte_mem_virt2memseg

2022-11-21 Thread okaya
From: Sinan Kaya In malloc_elem_find_max_iova_contig result of call to rte_mem_virt2memseg is dereferenced here and may be null. Signed-off-by: Sinan Kaya --- lib/eal/common/malloc_elem.c | 11 --- lib/eal/common/malloc_heap.c | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-)

[PATCH v2 09/11] malloc: check result of malloc_elem_free

2022-11-21 Thread okaya
From: Sinan Kaya In malloc_heap_free result of call to malloc_elem_free is dereferenced here and may be null. Signed-off-by: Sinan Kaya --- lib/eal/common/malloc_heap.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/eal/common/malloc_heap.c b/lib/eal/common/malloc_heap.c index 8827

[PATCH RESEND v2 00/11] codeql fixes for various subsystems

2022-11-22 Thread okaya
From: Sinan Kaya Following up the codeql reported problems first submitted by Stephen Hemminger here: https://lore.kernel.org/all/20220527161210.77212d0b@hermes.local/t/ Posting a series of fixes about potential null pointer accesses. Changes from v1: - Remove braces around single line stateme

[PATCH RESEND v2 01/11] ethdev: check return result of rte_eth_dev_info_get

2022-11-22 Thread okaya
From: Sinan Kaya rte_class_eth: eth_mac_cmp: The status of this call to rte_eth_dev_info_get is not checked, potentially leaving dev_info uninitialized. Signed-off-by: Sinan Kaya --- lib/ethdev/rte_class_eth.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/ethdev/rt

[PATCH RESEND v2 02/11] net/tap: check if name is null

2022-11-22 Thread okaya
From: Sinan Kaya In rte_pmd_tun_probe result of call to rte_vdev_device_name is dereferenced here and may be null. Signed-off-by: Sinan Kaya --- drivers/net/tap/rte_eth_tap.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c in

[PATCH RESEND v2 03/11] memzone: check result of rte_fbarray_get

2022-11-22 Thread okaya
From: Sinan Kaya In memzone_lookup_thread_unsafe result of call to rte_fbarray_get is dereferenced here and may be null. Signed-off-by: Sinan Kaya --- lib/eal/common/eal_common_memzone.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/eal/common/eal_common_memzone.

[PATCH RESEND v2 05/11] malloc: malloc_elem_join_adjacent_free can return null

2022-11-22 Thread okaya
From: Sinan Kaya In malloc_heap_add_memory result of call to malloc_elem_join_adjacent_free is dereferenced here and may be null. Signed-off-by: Sinan Kaya --- lib/eal/common/malloc_heap.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/eal/common/malloc_heap.c b/lib/eal/common/mallo

[PATCH RESEND v2 04/11] memzone: check result of malloc_elem_from_data

2022-11-22 Thread okaya
From: Sinan Kaya In memzone_reserve_aligned_thread_unsafe result of call to malloc_elem_from_data is dereferenced here and may be null. Signed-off-by: Sinan Kaya --- lib/eal/common/eal_common_memzone.c | 4 1 file changed, 4 insertions(+) diff --git a/lib/eal/common/eal_common_memzone.c

[PATCH RESEND v2 06/11] malloc: check result of rte_mem_virt2memseg_list

2022-11-22 Thread okaya
From: Sinan Kaya In alloc_pages_on_heap result of call to rte_mem_virt2memseg_list is dereferenced here and may be null. Signed-off-by: Sinan Kaya --- lib/eal/common/malloc_heap.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/eal/common/malloc_heap.c b/lib/eal/common/malloc_heap.c

[PATCH RESEND v2 08/11] malloc: check result of rte_mem_virt2memseg

2022-11-22 Thread okaya
From: Sinan Kaya In malloc_elem_find_max_iova_contig result of call to rte_mem_virt2memseg is dereferenced here and may be null. Signed-off-by: Sinan Kaya --- lib/eal/common/malloc_elem.c | 11 --- lib/eal/common/malloc_heap.c | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-)

[PATCH RESEND v2 07/11] malloc: check result of rte_fbarray_get

2022-11-22 Thread okaya
From: Sinan Kaya In eal_memalloc_is_contig result of call to rte_fbarray_get is dereferenced here and may be null. Signed-off-by: Sinan Kaya --- lib/eal/common/eal_common_memalloc.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/eal/common/eal_common_memalloc.c b/

[PATCH RESEND v2 09/11] malloc: check result of malloc_elem_free

2022-11-22 Thread okaya
From: Sinan Kaya In malloc_heap_free result of call to malloc_elem_free is dereferenced here and may be null. Signed-off-by: Sinan Kaya --- lib/eal/common/malloc_heap.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/eal/common/malloc_heap.c b/lib/eal/common/malloc_heap.c index 8827

[PATCH RESEND v2 10/11] malloc: check result of elem_start_pt

2022-11-22 Thread okaya
From: Sinan Kaya In malloc_elem_alloc result of call to elem_start_pt is dereferenced here and may be null. Signed-off-by: Sinan Kaya --- lib/eal/common/malloc_elem.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/eal/common/malloc_elem.c b/lib/eal/common/malloc_elem.c index 8f4981

[PATCH RESEND v2 11/11] bus/vdev: check result of rte_vdev_device_name

2022-11-22 Thread okaya
From: Sinan Kaya In rte_eth_vdev_allocate result of call to rte_vdev_device_name is dereferenced here and may be null. Signed-off-by: Sinan Kaya --- lib/ethdev/ethdev_vdev.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ethdev/ethdev_vdev.h b/lib/ethdev/ethdev_vdev.h index 364f140f