public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] RDMA/core: Fix uninitialized gid in ib_nl_process_good_ip_rsep()
@ 2025-11-07  4:10 Kriish Sharma
  2025-11-07 15:37 ` Jason Gunthorpe
  0 siblings, 1 reply; 8+ messages in thread
From: Kriish Sharma @ 2025-11-07  4:10 UTC (permalink / raw)
  To: Jason Gunthorpe, Leon Romanovsky, Vlad Dumitrescu, Parav Pandit,
	Edward Srouji
  Cc: linux-rdma, linux-kernel, Kriish Sharma,
	syzbot+938fcd548c303fe33c1a

KMSAN reported a use of uninitialized memory in hex_byte_pack()
via ip6_string() when printing %pI6 from ib_nl_handle_ip_res_resp().
If the LS_NLA_TYPE_DGID attribute is missing, 'gid' remains
uninitialized before being used in pr_info(), leading to a
KMSAN uninit-value report.

Reported-by: syzbot+938fcd548c303fe33c1a@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=938fcd548c303fe33c1a
Fixes: ae43f8286730 ("IB/core: Add IP to GID netlink offload")
Signed-off-by: Kriish Sharma <kriish.sharma2006@gmail.com>
---
 drivers/infiniband/core/addr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/core/addr.c b/drivers/infiniband/core/addr.c
index 61596cda2b65..4c602fcae12f 100644
--- a/drivers/infiniband/core/addr.c
+++ b/drivers/infiniband/core/addr.c
@@ -99,7 +99,7 @@ static inline bool ib_nl_is_good_ip_resp(const struct nlmsghdr *nlh)
 static void ib_nl_process_good_ip_rsep(const struct nlmsghdr *nlh)
 {
 	const struct nlattr *head, *curr;
-	union ib_gid gid;
+	union ib_gid gid = {};
 	struct addr_req *req;
 	int len, rem;
 	int found = 0;
-- 
2.34.1


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

end of thread, other threads:[~2025-11-08  3:48 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-07  4:10 [PATCH] RDMA/core: Fix uninitialized gid in ib_nl_process_good_ip_rsep() Kriish Sharma
2025-11-07 15:37 ` Jason Gunthorpe
2025-11-07 18:13   ` Kriish Sharma
2025-11-07 19:11   ` Vlad Dumitrescu
2025-11-07 19:17     ` Jason Gunthorpe
2025-11-07 19:58       ` Kriish Sharma
2025-11-07 21:06         ` Vlad Dumitrescu
2025-11-08  3:48           ` Kriish Sharma

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox