lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20240927191818.3576242-1-shum.sdl@nppct.ru>
Date: Fri, 27 Sep 2024 22:18:18 +0300
From: Andrey Shumilin <shum.sdl@...ct.ru>
To: ichal Kalderon <mkalderon@...vell.com>
Cc: Andrey Shumilin <shum.sdl@...ct.ru>,
	Ariel Elior <aelior@...vell.com>,
	Doug Ledford <dledford@...hat.com>,
	Jason Gunthorpe <jgg@...pe.ca>,
	linux-rdma@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	lvc-project@...uxtesting.org,
	khoroshilov@...ras.ru,
	ykarpov@...ras.ru,
	vmerzlyakov@...ras.ru,
	vefanov@...ras.ru
Subject: [PATCH] qedr/verbs: Add pd pointer null check

It is possible that a null pointer will be passed
to the qedr_set_common_qp_params function.
The patch adds a pointer check before dereferencing.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Andrey Shumilin <shum.sdl@...ct.ru>

---
 drivers/infiniband/hw/qedr/verbs.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/infiniband/hw/qedr/verbs.c b/drivers/infiniband/hw/qedr/verbs.c
index 511c95bb3d01..09bb7fbe2bba 100644
--- a/drivers/infiniband/hw/qedr/verbs.c
+++ b/drivers/infiniband/hw/qedr/verbs.c
@@ -2270,6 +2270,11 @@ struct ib_qp *qedr_create_qp(struct ib_pd *ibpd,
 		return ERR_PTR(-ENOMEM);
 	}
 
+	if (!pd) {
+		DP_ERR(dev, "create qp: pd is NULL\n");
+		return ERR_PTR(-EINVAL);
+	}
+
 	qedr_set_common_qp_params(dev, qp, pd, attrs);
 
 	if (attrs->qp_type == IB_QPT_GSI) {
-- 
2.30.2


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ