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 ED84818C32C for ; Fri, 27 Sep 2024 12:40:46 +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=1727440847; cv=none; b=VIuZaMb7prgOwlF3dLGqJx0+7vtfavI8H/DdqHCcF5aFUjvHEihUo3Eppgpmw2JVcMRJyrkuACuuvx5KkwwoJvkkqtTUO/NqSuP+lQjeq7jWjXaAnckx2ALk4QioVZWC99/CB48zqxD0GKZsoGutjpu4X4PibUVofMflRjznZ14= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727440847; c=relaxed/simple; bh=rKLeTCp1YkndOz46rzO932nn9Ve66C+efaBO1YpnA0Y=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=JeloabXTeX+UeuzTFk1QJjjR75f4wIt7j4u09urad+8CNSxuWugSVkouawA4PPilxRGQGp8DbYVu/BZwixc37ahtpSWlpUggeVsNH6ZDH+nsP9FTrR3t3eGGVb9CSWWAw2p7MVIK/tmX/LM2jIIGsWaWsnsbDBQofXO/Eq8I/LI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=FEL7GqxV; 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="FEL7GqxV" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7E3A5C4CEC4; Fri, 27 Sep 2024 12:40:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1727440846; bh=rKLeTCp1YkndOz46rzO932nn9Ve66C+efaBO1YpnA0Y=; h=From:To:Cc:Subject:Date:Reply-to:From; b=FEL7GqxV63JS7GzdWxCIJi7BYSf2ppuTX1byC0LYUgqC7HRHUvuHCmF/ZvBXaFYUy B0noKGYqP+4fmVlFnlD9mZhB6aPIhnCQwf3jUVovC1kmB5Jvte6S5O/45Yzuo3ezon DgGIXoCK+0lkY97V3ul4Kln4eUQp+i9H8xD7b+kU= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-46847: mm: vmalloc: ensure vmap_block is initialised before adding to queue Date: Fri, 27 Sep 2024 14:40:15 +0200 Message-ID: <2024092756-CVE-2024-46847-e469@gregkh> X-Mailer: git-send-email 2.46.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=2978; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=rKLeTCp1YkndOz46rzO932nn9Ve66C+efaBO1YpnA0Y=; b=owGbwMvMwCRo6H6F97bub03G02pJDGnfls/ZuMbBScOx44bway+p55NLT8w8tUF60o5qnl37l jq2bbTa3BHLwiDIxCArpsjyZRvP0f0VhxS9DG1Pw8xhZQIZwsDFKQAT+b2HYZ6V/kXx8vNVb/Yf 4rtqxXfoT5JTmAfD/PxvQQrG2zhPTeoSVfvXIJbxbe+D3QA= 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: mm: vmalloc: ensure vmap_block is initialised before adding to queue Commit 8c61291fd850 ("mm: fix incorrect vbq reference in purge_fragmented_block") extended the 'vmap_block' structure to contain a 'cpu' field which is set at allocation time to the id of the initialising CPU. When a new 'vmap_block' is being instantiated by new_vmap_block(), the partially initialised structure is added to the local 'vmap_block_queue' xarray before the 'cpu' field has been initialised. If another CPU is concurrently walking the xarray (e.g. via vm_unmap_aliases()), then it may perform an out-of-bounds access to the remote queue thanks to an uninitialised index. This has been observed as UBSAN errors in Android: | Internal error: UBSAN: array index out of bounds: 00000000f2005512 [#1] PREEMPT SMP | | Call trace: | purge_fragmented_block+0x204/0x21c | _vm_unmap_aliases+0x170/0x378 | vm_unmap_aliases+0x1c/0x28 | change_memory_common+0x1dc/0x26c | set_memory_ro+0x18/0x24 | module_enable_ro+0x98/0x238 | do_init_module+0x1b0/0x310 Move the initialisation of 'vb->cpu' in new_vmap_block() ahead of the addition to the xarray. The Linux kernel CVE team has assigned CVE-2024-46847 to this issue. Affected and fixed versions =========================== Issue introduced in 6.6.37 with commit 88e0ad40d08a and fixed in 6.6.51 with commit 1b2770e27d6d Issue introduced in 6.10 with commit 8c61291fd850 and fixed in 6.10.10 with commit 6cf74e0e5e3a Issue introduced in 6.10 with commit 8c61291fd850 and fixed in 6.11 with commit 3e3de7947c75 Issue introduced in 6.9.8 with commit 9983b81579be 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-46847 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: mm/vmalloc.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/1b2770e27d6d952f491bb362b657e5b2713c3efd https://git.kernel.org/stable/c/6cf74e0e5e3ab5d5c9defb4c73dad54d52224671 https://git.kernel.org/stable/c/3e3de7947c751509027d26b679ecd243bc9db255