DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev]  net/bonding: fix possible null pointer reference
@ 2019-01-08 11:17 Declan Doherty
  2019-01-09 14:04 ` Ferruh Yigit
  0 siblings, 1 reply; 2+ messages in thread
From: Declan Doherty @ 2019-01-08 11:17 UTC (permalink / raw)
  To: dev; +Cc: stable, Chas Williams, Declan Doherty

In function check_for_bonded_ethdev the driver name is used without
validating the pointer references in the passed ethdev object.

Fixes: 740feaf349b1 ("ethdev: remove driver name from device private data")
Cc: stable@dpdk.org

Signed-off-by: Declan Doherty <declan.doherty@intel.com>
---
 drivers/net/bonding/rte_eth_bond_api.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c
index 21bcd5044..e5e146540 100644
--- a/drivers/net/bonding/rte_eth_bond_api.c
+++ b/drivers/net/bonding/rte_eth_bond_api.c
@@ -19,7 +19,10 @@ int
 check_for_bonded_ethdev(const struct rte_eth_dev *eth_dev)
 {
 	/* Check valid pointer */
-	if (eth_dev->device->driver->name == NULL)
+	if (eth_dev == NULL ||
+		eth_dev->device == NULL ||
+		eth_dev->device->driver == NULL ||
+		eth_dev->device->driver->name == NULL)
 		return -1;
 
 	/* return 0 if driver name matches */
-- 
2.14.5

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-dev] net/bonding: fix possible null pointer reference
  2019-01-08 11:17 [dpdk-dev] net/bonding: fix possible null pointer reference Declan Doherty
@ 2019-01-09 14:04 ` Ferruh Yigit
  0 siblings, 0 replies; 2+ messages in thread
From: Ferruh Yigit @ 2019-01-09 14:04 UTC (permalink / raw)
  To: Declan Doherty, dev; +Cc: stable, Chas Williams

On 1/8/2019 11:17 AM, Declan Doherty wrote:
> In function check_for_bonded_ethdev the driver name is used without
> validating the pointer references in the passed ethdev object.
> 
> Fixes: 740feaf349b1 ("ethdev: remove driver name from device private data")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Declan Doherty <declan.doherty@intel.com>

Applied to dpdk-next-net/master, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-01-09 14:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-08 11:17 [dpdk-dev] net/bonding: fix possible null pointer reference Declan Doherty
2019-01-09 14:04 ` 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).