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 A7A1518CBFC for ; Fri, 27 Sep 2024 12:44:25 +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=1727441065; cv=none; b=NNAzwBL1ozmKCIdb31r2rOdwvwryIkJbj+yBNmYlfxEybepn9BWcM8jYjKPeXRh57P7QWOFe/MbF22w4iRl8IdHoxb7aWP25zLM6EdlPeypCEs9Y+2uzHIoPveZAY2VtKuC5oV9kRkBy+O82sC5bqq/+OC3YYbowIWHWcaDeIek= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727441065; c=relaxed/simple; bh=TcrlH2/HDa/v6LfE27QDseQGV0QEv0T7GN/jHobCjf0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=FelrtEG3Pls1plq1Jj35tLAnEOjp6zQeTingfFisRwoKuhhcR/vsxG7SvP7oiLeQaXgI0pk+yFCutVOLpffv6yypaOnlpft9hw5Oq/8h/FZ/fcmDcLC+uVWiMGQ7/CThuAr9n2a36mpwZg0LuHbcD3nGpHDLyCaKqddORpUW3tY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=eVAIaKGC; 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="eVAIaKGC" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 36BC2C4CEC4; Fri, 27 Sep 2024 12:44:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1727441065; bh=TcrlH2/HDa/v6LfE27QDseQGV0QEv0T7GN/jHobCjf0=; h=From:To:Cc:Subject:Date:Reply-to:From; b=eVAIaKGCG0ZOsqVeVr1091EwixL1eVYQmjbkXK0vzZbxp9SBW7B3unfwXj+YP9KnM U/ugsiL9om/7l6ZJFnsiCOpA4Buqppkcf+GEt0Jl7HGA39POUF2VqS8KF2lFt2iirk 6ccNwMupZq7zuN1SeHfFSD37XWo8beDBcNzsrOOo= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-46852: dma-buf: heaps: Fix off-by-one in CMA heap fault handler Date: Fri, 27 Sep 2024 14:43:45 +0200 Message-ID: <2024092742-CVE-2024-46852-91a5@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=2570; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=TcrlH2/HDa/v6LfE27QDseQGV0QEv0T7GN/jHobCjf0=; b=owGbwMvMwCRo6H6F97bub03G02pJDGnfVtS1exbPC5rKWHXOSdd3SZAnv6zP7LrQmvblp1Qre Qq59Uo6YlkYBJkYZMUUWb5s4zm6v+KQopeh7WmYOaxMIEMYuDgFYCICbxjme3/jVDZd5h5spyLj I5ZV/irLJtiLYZ6ZsXHcosxp3gf/HI+uL1OTtgpXmAYA 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-buf: heaps: Fix off-by-one in CMA heap fault handler Until VM_DONTEXPAND was added in commit 1c1914d6e8c6 ("dma-buf: heaps: Don't track CMA dma-buf pages under RssFile") it was possible to obtain a mapping larger than the buffer size via mremap and bypass the overflow check in dma_buf_mmap_internal. When using such a mapping to attempt to fault past the end of the buffer, the CMA heap fault handler also checks the fault offset against the buffer size, but gets the boundary wrong by 1. Fix the boundary check so that we don't read off the end of the pages array and insert an arbitrary page in the mapping. The Linux kernel CVE team has assigned CVE-2024-46852 to this issue. Affected and fixed versions =========================== Issue introduced in 5.11 with commit a5d2d29e24be and fixed in 6.1.111 with commit 84175dc5b2c9 Issue introduced in 5.11 with commit a5d2d29e24be and fixed in 6.6.52 with commit eb7fc8b65cea Issue introduced in 5.11 with commit a5d2d29e24be and fixed in 6.10.11 with commit e79050882b85 Issue introduced in 5.11 with commit a5d2d29e24be and fixed in 6.11 with commit ea5ff5d351b5 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-46852 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/dma-buf/heaps/cma_heap.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/84175dc5b2c932266a50c04e5ce342c30f817a2f https://git.kernel.org/stable/c/eb7fc8b65cea22f9038c52398c8b22849e9620ea https://git.kernel.org/stable/c/e79050882b857c37634baedbdcf7c2047c24cbff https://git.kernel.org/stable/c/ea5ff5d351b520524019f7ff7f9ce418de2dad87