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 A1E8B1AB37B for ; Thu, 20 Jun 2024 11:18:10 +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=1718882290; cv=none; b=Ee5YdYHDeCmNW4SX4MfHDA5xE/pQNMfiXfFIGdBhNApKkeP/pv/nA0gZgif+G5vtfpRYMGIPiM4hOIbPI+JqBznHoxdqX4JGwUAM3rQJdoX2FL5xAOQHZ6dneSBd3I0nruKck3h+DLrCnCsE82WADYOsepwMuOk9IxrbiDs5zT0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718882290; c=relaxed/simple; bh=0hMDaf6fdXsRQmsDoUHQYRXZ9UeFRSRWKsZCCi8MPpc=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=meuzcfacTsIF9gUbdcrBq0jpfr//Y8T+K9WWrSXgDk41TxFN91NHa/hY0gcvLfkB0cDCj+Z/rIxcPVKr8+xGFonv5drLMCKKRZwtDZzjEEVlvqVa30wj4TsbkK9bkOhT5r0t8QyoDiIfSOBB3K9Qo0oq2N1x+ZyhxFCdD/+4Jpo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=sfEEk3KV; 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="sfEEk3KV" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D5309C2BD10; Thu, 20 Jun 2024 11:18:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1718882290; bh=0hMDaf6fdXsRQmsDoUHQYRXZ9UeFRSRWKsZCCi8MPpc=; h=From:To:Cc:Subject:Date:Reply-to:From; b=sfEEk3KVRzk0QV8hrQdQ2xIiBAxKXzcsiieSCljil1HUsyeH2OC7QRtMcfGs0lvTh g73TWO+jO3FvUbV3lkoLHx6vzAoKX2TqKHz0qZQ4OigF2gAWupe1xWkeWsbE1fQ0fy vwzJgewBDgwdcQHJFAn2CVGYoAw3b/LJfLfxK5YU= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-48726: RDMA/ucma: Protect mc during concurrent multicast leaves Date: Thu, 20 Jun 2024 13:16:06 +0200 Message-ID: <2024062058-CVE-2022-48726-adb1@gregkh> X-Mailer: git-send-email 2.45.2 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=3634; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=0hMDaf6fdXsRQmsDoUHQYRXZ9UeFRSRWKsZCCi8MPpc=; b=owGbwMvMwCRo6H6F97bub03G02pJDGkl/HmOPlyz4jResVm+/B2csCt01SQG1rchH1u+Rn304 XncncjXEcvCIMjEICumyPJlG8/R/RWHFL0MbU/DzGFlAhnCwMUpABM5G8IwP2b7v3qWXR/KVRdF vE7215TUF/C+wbBg8v+cf4vvti/8ulCTVfrC1yPJDI+TAQ== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit Description =========== In the Linux kernel, the following vulnerability has been resolved: RDMA/ucma: Protect mc during concurrent multicast leaves Partially revert the commit mentioned in the Fixes line to make sure that allocation and erasing multicast struct are locked. BUG: KASAN: use-after-free in ucma_cleanup_multicast drivers/infiniband/core/ucma.c:491 [inline] BUG: KASAN: use-after-free in ucma_destroy_private_ctx+0x914/0xb70 drivers/infiniband/core/ucma.c:579 Read of size 8 at addr ffff88801bb74b00 by task syz-executor.1/25529 CPU: 0 PID: 25529 Comm: syz-executor.1 Not tainted 5.16.0-rc7-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description.constprop.0.cold+0x8d/0x320 mm/kasan/report.c:247 __kasan_report mm/kasan/report.c:433 [inline] kasan_report.cold+0x83/0xdf mm/kasan/report.c:450 ucma_cleanup_multicast drivers/infiniband/core/ucma.c:491 [inline] ucma_destroy_private_ctx+0x914/0xb70 drivers/infiniband/core/ucma.c:579 ucma_destroy_id+0x1e6/0x280 drivers/infiniband/core/ucma.c:614 ucma_write+0x25c/0x350 drivers/infiniband/core/ucma.c:1732 vfs_write+0x28e/0xae0 fs/read_write.c:588 ksys_write+0x1ee/0x250 fs/read_write.c:643 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Currently the xarray search can touch a concurrently freeing mc as the xa_for_each() is not surrounded by any lock. Rather than hold the lock for a full scan hold it only for the effected items, which is usually an empty list. The Linux kernel CVE team has assigned CVE-2022-48726 to this issue. Affected and fixed versions =========================== Issue introduced in 5.10 with commit 95fe51096b7a and fixed in 5.10.99 with commit 75c610212b9f Issue introduced in 5.10 with commit 95fe51096b7a and fixed in 5.15.22 with commit 2923948ffe08 Issue introduced in 5.10 with commit 95fe51096b7a and fixed in 5.16.8 with commit ee2477e8ccd3 Issue introduced in 5.10 with commit 95fe51096b7a and fixed in 5.17 with commit 36e8169ec973 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-48726 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/core/ucma.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/75c610212b9f1756b9384911d3a2c347eee8031c https://git.kernel.org/stable/c/2923948ffe0835f7114e948b35bcc42bc9b3baa1 https://git.kernel.org/stable/c/ee2477e8ccd3d978eeac0dc5a981b286d9bb7b0a https://git.kernel.org/stable/c/36e8169ec973359f671f9ec7213547059cae972e