* [dpdk-stable] [PATCH v2 01/14] bus/dpaa: fix null pointer dereference [not found] <20200624122701.1369327-1-maxime.coquelin@redhat.com> @ 2020-06-24 12:26 ` Maxime Coquelin 2020-06-26 10:13 ` Adrian Moreno 2020-06-24 12:26 ` [dpdk-stable] [PATCH v2 02/14] bus/fslmc: " Maxime Coquelin 1 sibling, 1 reply; 4+ messages in thread From: Maxime Coquelin @ 2020-06-24 12:26 UTC (permalink / raw) To: matan, xiao.w.wang, zhihong.wang, chenbo.xia, david.marchand, amorenoz, viacheslavo, hemant.agrawal, sachin.saxena, grive, dev Cc: Maxime Coquelin, stable, shreyansh.jain This patches fixes a null pointer derefencing that happens when the device string passed to the iterator is NULL. This situation can happen when iterating on a class type. For example: RTE_DEV_FOREACH(dev, "class=eth", &dev_iter) { ... } Fixes: e79df833d3f6 ("bus/dpaa: support hotplug ops") Cc: stable@dpdk.org Cc: shreyansh.jain@nxp.com Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com> --- drivers/bus/dpaa/dpaa_bus.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c index d53fe6083a..216f38acd4 100644 --- a/drivers/bus/dpaa/dpaa_bus.c +++ b/drivers/bus/dpaa/dpaa_bus.c @@ -703,6 +703,11 @@ dpaa_bus_dev_iterate(const void *start, const char *str, struct rte_dpaa_device *dev; char *dup, *dev_name = NULL; + if (str == NULL) { + DPAA_BUS_DEBUG("No device string\n"); + return NULL; + } + /* Expectation is that device would be name=device_name */ if (strncmp(str, "name=", 5) != 0) { DPAA_BUS_DEBUG("Invalid device string (%s)\n", str); -- 2.26.2 ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-stable] [PATCH v2 01/14] bus/dpaa: fix null pointer dereference 2020-06-24 12:26 ` [dpdk-stable] [PATCH v2 01/14] bus/dpaa: fix null pointer dereference Maxime Coquelin @ 2020-06-26 10:13 ` Adrian Moreno 2020-06-26 10:15 ` Maxime Coquelin 0 siblings, 1 reply; 4+ messages in thread From: Adrian Moreno @ 2020-06-26 10:13 UTC (permalink / raw) To: Maxime Coquelin, matan, xiao.w.wang, zhihong.wang, chenbo.xia, david.marchand, viacheslavo, hemant.agrawal, sachin.saxena, grive, dev Cc: stable, shreyansh.jain On 6/24/20 2:26 PM, Maxime Coquelin wrote: > This patches fixes a null pointer derefencing that happens > when the device string passed to the iterator is NULL. This > situation can happen when iterating on a class type. > For example: > > RTE_DEV_FOREACH(dev, "class=eth", &dev_iter) { > ... > } > > Fixes: e79df833d3f6 ("bus/dpaa: support hotplug ops") > Cc: stable@dpdk.org > Cc: shreyansh.jain@nxp.com > > Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com> > --- > drivers/bus/dpaa/dpaa_bus.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c > index d53fe6083a..216f38acd4 100644 > --- a/drivers/bus/dpaa/dpaa_bus.c > +++ b/drivers/bus/dpaa/dpaa_bus.c > @@ -703,6 +703,11 @@ dpaa_bus_dev_iterate(const void *start, const char *str, > struct rte_dpaa_device *dev; > char *dup, *dev_name = NULL; > > + if (str == NULL) { > + DPAA_BUS_DEBUG("No device string\n"); > + return NULL; > + } > + nitpicky: technically the trailing "\n" is not needed. Feel free to ignore > /* Expectation is that device would be name=device_name */ > if (strncmp(str, "name=", 5) != 0) { > DPAA_BUS_DEBUG("Invalid device string (%s)\n", str); > Acked-by: Adrián Moreno <amorenoz@redhat.com> -- Adrián Moreno ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-stable] [PATCH v2 01/14] bus/dpaa: fix null pointer dereference 2020-06-26 10:13 ` Adrian Moreno @ 2020-06-26 10:15 ` Maxime Coquelin 0 siblings, 0 replies; 4+ messages in thread From: Maxime Coquelin @ 2020-06-26 10:15 UTC (permalink / raw) To: Adrian Moreno, matan, xiao.w.wang, zhihong.wang, chenbo.xia, david.marchand, viacheslavo, hemant.agrawal, sachin.saxena, grive, dev Cc: stable, shreyansh.jain On 6/26/20 12:13 PM, Adrian Moreno wrote: > > > On 6/24/20 2:26 PM, Maxime Coquelin wrote: >> This patches fixes a null pointer derefencing that happens >> when the device string passed to the iterator is NULL. This >> situation can happen when iterating on a class type. >> For example: >> >> RTE_DEV_FOREACH(dev, "class=eth", &dev_iter) { >> ... >> } >> >> Fixes: e79df833d3f6 ("bus/dpaa: support hotplug ops") >> Cc: stable@dpdk.org >> Cc: shreyansh.jain@nxp.com >> >> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com> >> --- >> drivers/bus/dpaa/dpaa_bus.c | 5 +++++ >> 1 file changed, 5 insertions(+) >> >> diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c >> index d53fe6083a..216f38acd4 100644 >> --- a/drivers/bus/dpaa/dpaa_bus.c >> +++ b/drivers/bus/dpaa/dpaa_bus.c >> @@ -703,6 +703,11 @@ dpaa_bus_dev_iterate(const void *start, const char *str, >> struct rte_dpaa_device *dev; >> char *dup, *dev_name = NULL; >> >> + if (str == NULL) { >> + DPAA_BUS_DEBUG("No device string\n"); >> + return NULL; >> + } >> + > nitpicky: technically the trailing "\n" is not needed. Feel free to ignore Thanks, I'll fix while applying. > >> /* Expectation is that device would be name=device_name */ >> if (strncmp(str, "name=", 5) != 0) { >> DPAA_BUS_DEBUG("Invalid device string (%s)\n", str); >> > > Acked-by: Adrián Moreno <amorenoz@redhat.com> > ^ permalink raw reply [flat|nested] 4+ messages in thread
* [dpdk-stable] [PATCH v2 02/14] bus/fslmc: fix null pointer dereference [not found] <20200624122701.1369327-1-maxime.coquelin@redhat.com> 2020-06-24 12:26 ` [dpdk-stable] [PATCH v2 01/14] bus/dpaa: fix null pointer dereference Maxime Coquelin @ 2020-06-24 12:26 ` Maxime Coquelin 1 sibling, 0 replies; 4+ messages in thread From: Maxime Coquelin @ 2020-06-24 12:26 UTC (permalink / raw) To: matan, xiao.w.wang, zhihong.wang, chenbo.xia, david.marchand, amorenoz, viacheslavo, hemant.agrawal, sachin.saxena, grive, dev Cc: Maxime Coquelin, stable, shreyansh.jain This patches fixes a null pointer derefencing that happens when the device string passed to the iterator is NULL. This situation can happen when iterating on a class type. For example: RTE_DEV_FOREACH(dev, "class=eth", &dev_iter) { ... } Fixes: e67a61614d0b ("bus/fslmc: support device iteration") Cc: stable@dpdk.org Cc: shreyansh.jain@nxp.com Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com> --- drivers/bus/fslmc/fslmc_bus.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c index afbd82e8db..75c15d6b67 100644 --- a/drivers/bus/fslmc/fslmc_bus.c +++ b/drivers/bus/fslmc/fslmc_bus.c @@ -603,6 +603,11 @@ fslmc_bus_dev_iterate(const void *start, const char *str, struct rte_dpaa2_device *dev; char *dup, *dev_name = NULL; + if (str == NULL) { + DPAA2_BUS_DEBUG("No device string\n"); + return NULL; + } + /* Expectation is that device would be name=device_name */ if (strncmp(str, "name=", 5) != 0) { DPAA2_BUS_DEBUG("Invalid device string (%s)\n", str); -- 2.26.2 ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-06-26 10:16 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <20200624122701.1369327-1-maxime.coquelin@redhat.com> 2020-06-24 12:26 ` [dpdk-stable] [PATCH v2 01/14] bus/dpaa: fix null pointer dereference Maxime Coquelin 2020-06-26 10:13 ` Adrian Moreno 2020-06-26 10:15 ` Maxime Coquelin 2020-06-24 12:26 ` [dpdk-stable] [PATCH v2 02/14] bus/fslmc: " Maxime Coquelin
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).