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 A430E28DB5C for ; Wed, 18 Jun 2025 11:12:28 +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=1750245148; cv=none; b=kQGMkkFzWuPPc5YbGKjWQ2aj8y5I3Ymx0UrpcxaDQ4YBI+83pfoJj9j0SQXPi4lewGfke1tQJh+tvPTtKPw3UXpmNTYfBS0jgHaJtJRnYFVOo7pqXYym7VAYIN7vzay1P7NTaDyIPH1FzvbPJORLEBZRUi0nwrVvM47X8Hsh820= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750245148; c=relaxed/simple; bh=d6FNTo5JLFNFfRcIxJMunNj7GZTC3/u8fuRwlvBTftU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=nA2hiBigPXjSyFgM7quYDdUv6P/XuhuSX7Yx459hHGYfFiEpy2FOwHHd1Z7q9PmoSBik4Bjd6omG8MLhtFNFkD0i4S+gyexATX5lQoHwjQQN9PBQUKPe9RCHnfq0kuC+7efaqLcmyTrcTCOj06SzD3uo7+YS+VabS6tIH7aDvwk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=RB/ol0EZ; 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="RB/ol0EZ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1291EC4CEE7; Wed, 18 Jun 2025 11:12:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1750245148; bh=d6FNTo5JLFNFfRcIxJMunNj7GZTC3/u8fuRwlvBTftU=; h=From:To:Cc:Subject:Date:Reply-to:From; b=RB/ol0EZnYTSb7JKvZ6fOfDFNiLidlyOUx3ac9YhW/9bVFteupPCXF4un45vJiBKS +UPQqP2YjyDncEdtxvyg2j/Aq5byRBU9uQWo5y+FEa5uIdzjWkfY2SbQBaPbdsxpTq LoTPGQGV1q6NvAKnjirkEsTlG2aIMc6Hoc20qk1M= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-50135: RDMA/rxe: Fix BUG: KASAN: null-ptr-deref in rxe_qp_do_cleanup Date: Wed, 18 Jun 2025 13:03:20 +0200 Message-ID: <2025061816-CVE-2022-50135-585a@gregkh> X-Mailer: git-send-email 2.49.0 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=2563; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=5Iup8UQEBG4WSHj8fb8czEeUXUmiRuT5AwEvub7YCj4=; b=owGbwMvMwCRo6H6F97bub03G02pJDBlBc2qurQtSZPzLnvLm5AL1betX/Xsaxxen90z3VH2WY 5DLAUORjlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZjIykUMC06zHI5e2RzSr2w4 d4tmoMmin29LDzLMj3G5dv3dSbmr32P+PXSp+XPgMd+X/QA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: RDMA/rxe: Fix BUG: KASAN: null-ptr-deref in rxe_qp_do_cleanup The function rxe_create_qp calls rxe_qp_from_init. If some error occurs, the error handler of function rxe_qp_from_init will set both scq and rcq to NULL. Then rxe_create_qp calls rxe_put to handle qp. In the end, rxe_qp_do_cleanup is called by rxe_put. rxe_qp_do_cleanup directly accesses scq and rcq before checking them. This will cause null-ptr-deref error. The call graph is as below: rxe_create_qp { ... rxe_qp_from_init { ... err1: ... qp->rcq = NULL; <---rcq is set to NULL qp->scq = NULL; <---scq is set to NULL ... } qp_init: rxe_put{ ... rxe_qp_do_cleanup { ... atomic_dec(&qp->scq->num_wq); <--- scq is accessed ... atomic_dec(&qp->rcq->num_wq); <--- rcq is accessed } } The Linux kernel CVE team has assigned CVE-2022-50135 to this issue. Affected and fixed versions =========================== Issue introduced in 5.19 with commit 4703b4f0d94a5f887297713a2f6c2916a1ef08fd and fixed in 5.19.2 with commit 8598b9d0a364c1663c96fc0fab9df0d36c809aea Issue introduced in 5.19 with commit 4703b4f0d94a5f887297713a2f6c2916a1ef08fd and fixed in 6.0 with commit 37da51efe6eaa0560f46803c8c436a48a2084da7 Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2022-50135 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: drivers/infiniband/sw/rxe/rxe_qp.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/8598b9d0a364c1663c96fc0fab9df0d36c809aea https://git.kernel.org/stable/c/37da51efe6eaa0560f46803c8c436a48a2084da7