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 C393632B11D; Sat, 30 May 2026 17:02:33 +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=1780160554; cv=none; b=bmerVHb6G8NyrcOcTVBCN4reL11akIQbIZYcoSIHhEYoOqGnGV0W194BPXplsMXdbTtBIBCOG9BfwdzstuIAkWgxZpjEcPjA5BpuqgYBJzJqSzLgnHjlyMQWrySyPhYAM6d/jFxzB7XvXUux5tgCbbIXbL/N2/BTrX8pW4XYcRw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780160554; c=relaxed/simple; bh=vzUUIGLrFrvt9EwCGXJ0Wo+YU4oZmLvgNEvz5l+cVQ0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SrW6Z/91BaS8gxlks0C5H2YxX9yoSUOxrH1nWrcdgVgJbVmMokXFFbRx4CnAtlxfv4jumihzdnENyqeB9LoxP/SczvyoEyVYL/Rrns+KYDbA9yFHFETSSKmIhUgVRKNOUnN1GcxDm2hHp9R/sk9O7q/UOs5iK3mL4T9zB43sr7Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=G9str9WF; 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="G9str9WF" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EE9791F00893; Sat, 30 May 2026 17:02:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1780160553; bh=rf/z5SGeXLYaMyKpctK9GL8IeWR1SCBX8gkp2evnfNM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=G9str9WFHSpMu+6LM3lWNhkDlyJkLrYg63xfWM+uEoEPADWWC2X7F7uV9G6UoVetE kPYLsrlT6L5fQ7zNbf5cat0AkejhRZTR+Oon6ePnT4jcgWcGLf2gjRDvJ6ntyHAAZY iHNxaTd5oRiVOBd3tHy0rx3C+QG2Tx9DYsz+BFNY= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Jason Gunthorpe Subject: [PATCH 6.1 368/969] RDMA/ocrdma: Dont NULL deref uctx on errors in ocrdma_copy_pd_uresp() Date: Sat, 30 May 2026 17:58:12 +0200 Message-ID: <20260530160310.483945297@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260530160300.485627683@linuxfoundation.org> References: <20260530160300.485627683@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 6.1-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; }