* [dpdk-dev] [PATCH] baseband/turbo_sw: fix dereference of null
@ 2021-04-22 9:25 Min Hu (Connor)
2021-04-22 15:20 ` Chautru, Nicolas
0 siblings, 1 reply; 3+ messages in thread
From: Min Hu (Connor) @ 2021-04-22 9:25 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, nicolas.chautru
Return value of a function 'rte_malloc' is dereferenced without
checking, and may result in segmetation fault.
This patch fixed it.
Fixes: 31a7853d1ed9 ("baseband/turbo_sw: support large size code block")
Cc: stable@dpdk.org
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
app/test-bbdev/test_bbdev_perf.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
index 45b85b9..f94e2a9 100644
--- a/app/test-bbdev/test_bbdev_perf.c
+++ b/app/test-bbdev/test_bbdev_perf.c
@@ -957,6 +957,9 @@ init_op_data_objs(struct rte_bbdev_op_data *bufs,
if ((op_type == DATA_INPUT) && large_input) {
/* Allocate a fake overused mbuf */
data = rte_malloc(NULL, seg->length, 0);
+ TEST_ASSERT_NOT_NULL(data,
+ "rte malloc failed with %u bytes",
+ seg->length);
memcpy(data, seg->addr, seg->length);
m_head->buf_addr = data;
m_head->buf_iova = rte_malloc_virt2iova(data);
--
2.7.4
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] [PATCH] baseband/turbo_sw: fix dereference of null
2021-04-22 9:25 [dpdk-dev] [PATCH] baseband/turbo_sw: fix dereference of null Min Hu (Connor)
@ 2021-04-22 15:20 ` Chautru, Nicolas
2021-05-05 13:57 ` Akhil Goyal
0 siblings, 1 reply; 3+ messages in thread
From: Chautru, Nicolas @ 2021-04-22 15:20 UTC (permalink / raw)
To: Min Hu (Connor), dev; +Cc: Yigit, Ferruh
> -----Original Message-----
> From: Min Hu (Connor) <humin29@huawei.com>
> Sent: Thursday, April 22, 2021 2:25 AM
>
> Return value of a function 'rte_malloc' is dereferenced without checking,
> and may result in segmetation fault.
>
> This patch fixed it.
>
> Fixes: 31a7853d1ed9 ("baseband/turbo_sw: support large size code block")
> Cc: stable@dpdk.org
>
> Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Acked-by: Nicolas Chautru <nicolas.chautru@intel.com>
> ---
> app/test-bbdev/test_bbdev_perf.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-
> bbdev/test_bbdev_perf.c
> index 45b85b9..f94e2a9 100644
> --- a/app/test-bbdev/test_bbdev_perf.c
> +++ b/app/test-bbdev/test_bbdev_perf.c
> @@ -957,6 +957,9 @@ init_op_data_objs(struct rte_bbdev_op_data *bufs,
> if ((op_type == DATA_INPUT) && large_input) {
> /* Allocate a fake overused mbuf */
> data = rte_malloc(NULL, seg->length, 0);
> + TEST_ASSERT_NOT_NULL(data,
> + "rte malloc failed with %u bytes",
> + seg->length);
> memcpy(data, seg->addr, seg->length);
> m_head->buf_addr = data;
> m_head->buf_iova =
> rte_malloc_virt2iova(data);
> --
> 2.7.4
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] [PATCH] baseband/turbo_sw: fix dereference of null
2021-04-22 15:20 ` Chautru, Nicolas
@ 2021-05-05 13:57 ` Akhil Goyal
0 siblings, 0 replies; 3+ messages in thread
From: Akhil Goyal @ 2021-05-05 13:57 UTC (permalink / raw)
To: Chautru, Nicolas, Min Hu (Connor), dev; +Cc: Yigit, Ferruh
>
>
> > -----Original Message-----
> > From: Min Hu (Connor) <humin29@huawei.com>
> > Sent: Thursday, April 22, 2021 2:25 AM
> >
> > Return value of a function 'rte_malloc' is dereferenced without checking,
> > and may result in segmetation fault.
> >
> > This patch fixed it.
> >
> > Fixes: 31a7853d1ed9 ("baseband/turbo_sw: support large size code block")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
>
> Acked-by: Nicolas Chautru <nicolas.chautru@intel.com>
>
Applied to dpdk-next-crypto
Thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-05-05 13:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-22 9:25 [dpdk-dev] [PATCH] baseband/turbo_sw: fix dereference of null Min Hu (Connor)
2021-04-22 15:20 ` Chautru, Nicolas
2021-05-05 13:57 ` Akhil Goyal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).