From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 1B7083EDE43; Tue, 12 May 2026 17:59:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778608755; cv=none; b=dxay3EPbm6bRVv2Xfjim9vxNglbKGLROj07o9laBdSVDeScSXLZ8mkXecA8CyK9UAc1uR70fQDXIMvSdHIj5sHf/gYmOq049E5DU6zE1xs8e39L75xVDk2XWq9tq84rUTNYhUQLBc3coFKGpDpNygkAFkPUQauIsMyuJ5YE6T5c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778608755; c=relaxed/simple; bh=pFVr5Z1SWKOg+/gfbMsmn1U4PSgQxZPB+U4ZUmYaixc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qeu2EICD0bzHB7Rb5/n1wa67yzYXZkQPT4RQWK57gE5NTyp7LoFNU5sGpwb9oUCN0Lcum3CLHXdGfTFLTvhYzbMTHBrdDNea5S5WX66RQzxVMghLmcsP2R1UoQaUwD0wUGhRB9hD8c1fWI1CKNTX7zexRHzDPOWyz5fk0eAI750= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=pFFaCaip; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="pFFaCaip" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A6C05C2BCB0; Tue, 12 May 2026 17:59:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1778608755; bh=pFVr5Z1SWKOg+/gfbMsmn1U4PSgQxZPB+U4ZUmYaixc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pFFaCaipIYnPM/mHk9kTJiWnfhigaMmYMizJzqPrHYAw9jdV4zElQ1Kw4AqfE/9y2 t4DJdWk/Bhq6BZUkDm28YGLBLMOVO4N632i2rV7/TAfNd6Uj9DM0Xopmh+c9Z46Odu 7+yM59sJoF/axZvofAro3nAsz5has9TaPTgu81ko= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Jason Gunthorpe Subject: [PATCH 6.18 201/270] RDMA/ocrdma: Dont NULL deref uctx on errors in ocrdma_copy_pd_uresp() Date: Tue, 12 May 2026 19:40:02 +0200 Message-ID: <20260512173942.683009779@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260512173938.452574370@linuxfoundation.org> References: <20260512173938.452574370@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-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 @@ -620,9 +620,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; }