From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 98776261B9E; Sat, 30 May 2026 17:55:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780163722; cv=none; b=iPte4cdhXNn7jFxdZ6iox+4H/3HK6Fb9kum7wXOJ7m4IPf18ySW2uhdiQPpFCEJUHFLZtEh+DnYQ0Ne1a9CNVUarMHpRy4Rhw+y0kJrxwLHXlro90TLnVwXJMsiK1w27cS41m+JUPgCpJhlY7gGMNiJw8HPszyjpbVhPLrI4frU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780163722; c=relaxed/simple; bh=lNnofKv4FutHg0jNLyDdhUcTsh3wPSNMrhJcuPf9xu8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gx21rO+8AHXF2LsDU6ign61FMtNM6At81wBVaKWnwrXSkvEGLqHTdwXaaYThJmdxHaRujl5JFDNAhH+n02ucfpJyeWg1u/QVCRB8H1BK5nEoTrWEJoqrC9/pQv22wFZL4wnZfDauNz7I2AkLf9YK6gMUcq5N2fAf75RfeTdp0yY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=yUOIlBcR; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="yUOIlBcR" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DCDDA1F00893; Sat, 30 May 2026 17:55:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1780163721; bh=+f1vfM15a6X4JOFaNVDWCV0XwKi20hn0Shxz4RypeEc=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=yUOIlBcR2Xd3yfDp13oFtpQaGIrGkcjhBPr1EgrRPLlfsEHAR5JdAADoShH/2Qz/y G/Hh4ixCXIZj4Qc0KobRE0QpPlvdhHJq0XpaLrpBnfxZxFfgx2+yFmgrKsR8yAFQ9F 5FXnLo9x8Fp5C45Qlwqx72SH50sX/YogOhCQjMBA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Jason Gunthorpe Subject: [PATCH 5.15 343/776] RDMA/ocrdma: Dont NULL deref uctx on errors in ocrdma_copy_pd_uresp() Date: Sat, 30 May 2026 18:00:57 +0200 Message-ID: <20260530160249.441301882@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260530160240.228940103@linuxfoundation.org> References: <20260530160240.228940103@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jason Gunthorpe commit 34fbf48cf3b410d2a6e8c586fa952a36331ca5ba upstream. Sashiko points out that pd->uctx isn't initialized until late in the function so all these error flow references are NULL and will crash. Use the uctx that isn't NULL. Cc: stable@vger.kernel.org Fixes: fe2caefcdf58 ("RDMA/ocrdma: Add driver for Emulex OneConnect IBoE RDMA adapter") Link: https://sashiko.dev/#/patchset/0-v1-e911b76a94d1%2B65d95-rdma_udata_rep_jgg%40nvidia.com?part=4 Link: https://patch.msgid.link/r/9-v1-41f3135e5565+9d2-rdma_ai_fixes1_jgg@nvidia.com Signed-off-by: Jason Gunthorpe Signed-off-by: Greg Kroah-Hartman --- drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c +++ b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c @@ -618,9 +618,9 @@ static int ocrdma_copy_pd_uresp(struct o ucopy_err: if (pd->dpp_enabled) - ocrdma_del_mmap(pd->uctx, dpp_page_addr, PAGE_SIZE); + ocrdma_del_mmap(uctx, dpp_page_addr, PAGE_SIZE); dpp_map_err: - ocrdma_del_mmap(pd->uctx, db_page_addr, db_page_size); + ocrdma_del_mmap(uctx, db_page_addr, db_page_size); return status; }