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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251218071012.7740-1-islituo@gmail.com>
Date: Thu, 18 Dec 2025 15:10:12 +0800
From: Tuo Li <islituo@...il.com>
To: ericvh@...nel.org,
	lucho@...kov.net,
	asmadeus@...ewreck.org,
	linux_oss@...debyte.com
Cc: v9fs@...ts.linux.dev,
	linux-kernel@...r.kernel.org,
	Tuo Li <islituo@...il.com>
Subject: [PATCH] net: 9p: Fix a possible null-pointer dereference in p9_cm_event_handler()

In p9_cm_event_handler(), rdma is checked in the RDMA_CM_EVENT_DISCONNECTED
case, indicating that it may be NULL. If this happens, a null-pointer
dereference can occur when complete() is called:

  complete(&rdma->cm_done);

To prevent such a potential null-pointer dereference, add a defensive check
before invoking complete().

Signed-off-by: Tuo Li <islituo@...il.com>
---
 net/9p/trans_rdma.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/9p/trans_rdma.c b/net/9p/trans_rdma.c
index 4d406479f83b..b5ceae1cccbb 100644
--- a/net/9p/trans_rdma.c
+++ b/net/9p/trans_rdma.c
@@ -170,7 +170,8 @@ p9_cm_event_handler(struct rdma_cm_id *id, struct rdma_cm_event *event)
 	default:
 		BUG();
 	}
-	complete(&rdma->cm_done);
+	if (rdma)
+		complete(&rdma->cm_done);
 	return 0;
 }
 
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ