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 87DA712D771 for ; Fri, 21 Jun 2024 11:18:58 +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=1718968738; cv=none; b=a0MSGwG7mQBDBekrSdFHALv29G3oHbNFv6tYqnUJ2QPx2vcnqOBm+mFE35ozOf5AW6ZnMzjfrZbfQyBrprVIb4DBpiUR8xLJm4b2a3MDEDXjAPYbprcq4YN/mDlOO0DBf3Sz8G2SpAF43zqDItTzRomTM6TTiT1SZVIPh3sbEr8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718968738; c=relaxed/simple; bh=pF7yJTUMr08HWGKSLQRIwNzFhuSSBlxPgnffWDxSmsg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=iFZrYWMoNmjdPuVcrM7x3LfFE/qKrYyjnbwVMLUNYmn3ZzuFLOgNnwuQwub6f/th+diOSRdhbCVkq70oLcWGCWvHILsdbDP9BMM9hiJfYV+5MwkzRY8dwj5kF9eYILY8TYeulHu1bAFxDzMa55vnArV4Twk4rat/7Gm9ST7kSKQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=FL7XsAvf; 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="FL7XsAvf" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7259FC2BBFC; Fri, 21 Jun 2024 11:18:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1718968738; bh=pF7yJTUMr08HWGKSLQRIwNzFhuSSBlxPgnffWDxSmsg=; h=From:To:Cc:Subject:Date:Reply-to:From; b=FL7XsAvfGm6e6YlmWqjfFWIQmwV4bHr8W2CDOzP3V0AuPpsoCNm6NZ+C+vgE4TzUR 5rzRkmJvTTNsjchrYaW36smYiwXOxXqi5tuNuLklcwhDVDVqPsftHIoQPnYbvKPVZ0 Wo/mFFY5ohaiL9DVCe09joybxqtqabfhPJVy3I0s= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-34777: dma-mapping: benchmark: fix node id validation Date: Fri, 21 Jun 2024 13:18:51 +0200 Message-ID: <2024062150-CVE-2024-34777-34d1@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=3478; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=pF7yJTUMr08HWGKSLQRIwNzFhuSSBlxPgnffWDxSmsg=; b=owGbwMvMwCRo6H6F97bub03G02pJDGmlibN6s1ZdXbT/R5XQx296/y8c/Luw9ti3G3ozp52Kj 9ZoqbL41RHLwiDIxCArpsjyZRvP0f0VhxS9DG1Pw8xhZQIZwsDFKQATcbnMML/4p3KZwrL2H/1f D0xQZJm2o6/FdiXD/MJasalJRusrZ+x+UdX/im9RWryQCAA= 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: dma-mapping: benchmark: fix node id validation While validating node ids in map_benchmark_ioctl(), node_possible() may be provided with invalid argument outside of [0,MAX_NUMNODES-1] range leading to: BUG: KASAN: wild-memory-access in map_benchmark_ioctl (kernel/dma/map_benchmark.c:214) Read of size 8 at addr 1fffffff8ccb6398 by task dma_map_benchma/971 CPU: 7 PID: 971 Comm: dma_map_benchma Not tainted 6.9.0-rc6 #37 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996) Call Trace: dump_stack_lvl (lib/dump_stack.c:117) kasan_report (mm/kasan/report.c:603) kasan_check_range (mm/kasan/generic.c:189) variable_test_bit (arch/x86/include/asm/bitops.h:227) [inline] arch_test_bit (arch/x86/include/asm/bitops.h:239) [inline] _test_bit at (include/asm-generic/bitops/instrumented-non-atomic.h:142) [inline] node_state (include/linux/nodemask.h:423) [inline] map_benchmark_ioctl (kernel/dma/map_benchmark.c:214) full_proxy_unlocked_ioctl (fs/debugfs/file.c:333) __x64_sys_ioctl (fs/ioctl.c:890) do_syscall_64 (arch/x86/entry/common.c:83) entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:130) Compare node ids with sane bounds first. NUMA_NO_NODE is considered a special valid case meaning that benchmarking kthreads won't be bound to a cpuset of a given node. Found by Linux Verification Center (linuxtesting.org). The Linux kernel CVE team has assigned CVE-2024-34777 to this issue. Affected and fixed versions =========================== Issue introduced in 5.11 with commit 65789daa8087 and fixed in 5.15.161 with commit 35d31c8bd472 Issue introduced in 5.11 with commit 65789daa8087 and fixed in 6.1.93 with commit c57874265a3c Issue introduced in 5.11 with commit 65789daa8087 and fixed in 6.6.33 with commit 34a816d8735f Issue introduced in 5.11 with commit 65789daa8087 and fixed in 6.9.4 with commit 63e7e05a48a3 Issue introduced in 5.11 with commit 65789daa8087 and fixed in 6.10-rc2 with commit 1ff05e723f7c 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-2024-34777 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: kernel/dma/map_benchmark.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/35d31c8bd4722b107f5a2f5ddddce839de04b936 https://git.kernel.org/stable/c/c57874265a3c5206d7aece3793bb2fc9abcd7570 https://git.kernel.org/stable/c/34a816d8735f3924b74be8e5bf766ade1f3bd10b https://git.kernel.org/stable/c/63e7e05a48a35308aeddd7ecccb68363a5988e87 https://git.kernel.org/stable/c/1ff05e723f7ca30644b8ec3fb093f16312e408ad