* [dpdk-dev] [PATCH 1/4] net/ark: fix for buffer not null terminated
@ 2017-05-16 16:14 John Miller
2017-05-16 16:14 ` [dpdk-dev] [PATCH 2/4] net/ark: fix return code not checked John Miller
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: John Miller @ 2017-05-16 16:14 UTC (permalink / raw)
To: dev; +Cc: ed.czeck, shepard.siegel, John Miller
Coverity issue: 144512
Coverity issue: 144513
Fixes: 9c7188a68d7b ("net/ark: provide API for hardware modules pktchkr and pktgen")
Signed-off-by: John Miller <john.miller@atomicrules.com>
---
drivers/net/ark/ark_pktchkr.c | 2 +-
drivers/net/ark/ark_pktgen.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ark/ark_pktchkr.c b/drivers/net/ark/ark_pktchkr.c
index 62b3673..c3040af 100644
--- a/drivers/net/ark/ark_pktchkr.c
+++ b/drivers/net/ark/ark_pktchkr.c
@@ -372,7 +372,7 @@ struct OPTIONS {
o->v.INT = atoll(val);
break;
case OTSTRING:
- strncpy(o->v.STR, val, ARK_MAX_STR_LEN);
+ snprintf(o->v.STR, ARK_MAX_STR_LEN, "%s", val);
break;
}
return 1;
diff --git a/drivers/net/ark/ark_pktgen.c b/drivers/net/ark/ark_pktgen.c
index bdac054..8c7a8a2 100644
--- a/drivers/net/ark/ark_pktgen.c
+++ b/drivers/net/ark/ark_pktgen.c
@@ -354,7 +354,7 @@ struct OPTIONS {
o->v.INT = atoll(val);
break;
case OTSTRING:
- strncpy(o->v.STR, val, ARK_MAX_STR_LEN);
+ snprintf(o->v.STR, ARK_MAX_STR_LEN, "%s", val);
break;
}
return 1;
--
1.9.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [dpdk-dev] [PATCH 2/4] net/ark: fix return code not checked
2017-05-16 16:14 [dpdk-dev] [PATCH 1/4] net/ark: fix for buffer not null terminated John Miller
@ 2017-05-16 16:14 ` John Miller
2017-05-16 16:14 ` [dpdk-dev] [PATCH 3/4] net/ark: fix null pointer dereference John Miller
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: John Miller @ 2017-05-16 16:14 UTC (permalink / raw)
To: dev; +Cc: ed.czeck, shepard.siegel, John Miller
Coverity issue: 144514
Fixes: 727b3fe292bc ("net/ark: integrate PMD")
Signed-off-by: John Miller <john.miller@atomicrules.com>
---
drivers/net/ark/ark_ethdev.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c
index 995c93d..9143fc4 100644
--- a/drivers/net/ark/ark_ethdev.c
+++ b/drivers/net/ark/ark_ethdev.c
@@ -588,7 +588,11 @@ static void eth_ark_macaddr_remove(struct rte_eth_dev *dev,
/* Delay packet generatpr start allow the hardware to be ready
* This is only used for sanity checking with internal generator
*/
- pthread_create(&thread, NULL, delay_pg_start, ark);
+ if (pthread_create(&thread, NULL, delay_pg_start, ark)) {
+ PMD_DRV_LOG(ERR, "Could not create pktgen "
+ "starter thread\n");
+ return -1;
+ }
}
if (ark->user_ext.dev_start)
--
1.9.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [dpdk-dev] [PATCH 3/4] net/ark: fix null pointer dereference
2017-05-16 16:14 [dpdk-dev] [PATCH 1/4] net/ark: fix for buffer not null terminated John Miller
2017-05-16 16:14 ` [dpdk-dev] [PATCH 2/4] net/ark: fix return code not checked John Miller
@ 2017-05-16 16:14 ` John Miller
2017-05-16 16:14 ` [dpdk-dev] [PATCH 4/4] net/ark: fix return value of null not checked John Miller
2017-05-16 16:37 ` [dpdk-dev] [PATCH 1/4] net/ark: fix for buffer not null terminated Ferruh Yigit
3 siblings, 0 replies; 5+ messages in thread
From: John Miller @ 2017-05-16 16:14 UTC (permalink / raw)
To: dev; +Cc: ed.czeck, shepard.siegel, John Miller
Coverity issue: 144520
Fixes: 727b3fe292bc ("net/ark: integrate PMD")
Signed-off-by: John Miller <john.miller@atomicrules.com>
---
drivers/net/ark/ark_ethdev.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c
index 9143fc4..f8fb359 100644
--- a/drivers/net/ark/ark_ethdev.c
+++ b/drivers/net/ark/ark_ethdev.c
@@ -516,11 +516,7 @@ static void eth_ark_macaddr_remove(struct rte_eth_dev *dev,
dev->dev_ops = NULL;
dev->rx_pkt_burst = NULL;
dev->tx_pkt_burst = NULL;
- if (dev->data->mac_addrs)
- rte_free(dev->data->mac_addrs);
- if (dev->data)
- rte_free(dev->data);
-
+ rte_free(dev->data->mac_addrs);
return 0;
}
--
1.9.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [dpdk-dev] [PATCH 4/4] net/ark: fix return value of null not checked
2017-05-16 16:14 [dpdk-dev] [PATCH 1/4] net/ark: fix for buffer not null terminated John Miller
2017-05-16 16:14 ` [dpdk-dev] [PATCH 2/4] net/ark: fix return code not checked John Miller
2017-05-16 16:14 ` [dpdk-dev] [PATCH 3/4] net/ark: fix null pointer dereference John Miller
@ 2017-05-16 16:14 ` John Miller
2017-05-16 16:37 ` [dpdk-dev] [PATCH 1/4] net/ark: fix for buffer not null terminated Ferruh Yigit
3 siblings, 0 replies; 5+ messages in thread
From: John Miller @ 2017-05-16 16:14 UTC (permalink / raw)
To: dev; +Cc: ed.czeck, shepard.siegel, John Miller
Coverity issue: 144517
Fixes: 1131cbf0fb2b ("net/ark: stub PMD for Atomic Rules Arkville")
Signed-off-by: John Miller <john.miller@atomicrules.com>
---
drivers/net/ark/ark_ethdev.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c
index f8fb359..017817e 100644
--- a/drivers/net/ark/ark_ethdev.c
+++ b/drivers/net/ark/ark_ethdev.c
@@ -899,6 +899,12 @@ static void eth_ark_macaddr_remove(struct rte_eth_dev *dev,
int size = 0;
int first = 1;
+ if (file == NULL) {
+ PMD_DRV_LOG(ERR, "Unable to open "
+ "config file %s\n", value);
+ return -1;
+ }
+
while (fgets(line, sizeof(line), file)) {
size += strlen(line);
if (size >= ARK_MAX_ARG_LEN) {
--
1.9.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] [PATCH 1/4] net/ark: fix for buffer not null terminated
2017-05-16 16:14 [dpdk-dev] [PATCH 1/4] net/ark: fix for buffer not null terminated John Miller
` (2 preceding siblings ...)
2017-05-16 16:14 ` [dpdk-dev] [PATCH 4/4] net/ark: fix return value of null not checked John Miller
@ 2017-05-16 16:37 ` Ferruh Yigit
3 siblings, 0 replies; 5+ messages in thread
From: Ferruh Yigit @ 2017-05-16 16:37 UTC (permalink / raw)
To: John Miller, dev; +Cc: ed.czeck, shepard.siegel
On 5/16/2017 5:14 PM, John Miller wrote:
> Coverity issue: 144512
> Coverity issue: 144513
> Fixes: 9c7188a68d7b ("net/ark: provide API for hardware modules pktchkr and pktgen")
>
> Signed-off-by: John Miller <john.miller@atomicrules.com>
Series applied to dpdk-next-net/master, thanks.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-05-16 16:37 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-16 16:14 [dpdk-dev] [PATCH 1/4] net/ark: fix for buffer not null terminated John Miller
2017-05-16 16:14 ` [dpdk-dev] [PATCH 2/4] net/ark: fix return code not checked John Miller
2017-05-16 16:14 ` [dpdk-dev] [PATCH 3/4] net/ark: fix null pointer dereference John Miller
2017-05-16 16:14 ` [dpdk-dev] [PATCH 4/4] net/ark: fix return value of null not checked John Miller
2017-05-16 16:37 ` [dpdk-dev] [PATCH 1/4] net/ark: fix for buffer not null terminated Ferruh Yigit
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).