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 3D3B7136A for ; Wed, 18 Sep 2024 07:17:18 +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=1726643838; cv=none; b=ep3uwRTbstSV0jBMt/s+uoaW4tuxJQflAfPtDjsGMO9ZvrxjFxfPjujC6qPqkqPZo92/saEz4uLj17biAwLzh3I+7scKOumCmlBDMCj0roOxp6lD50L9jAH3+7pPloLRUO3AV70N0N71cN3cSApIW1Bkjh8YwUBS3FCIZxHOcFk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726643838; c=relaxed/simple; bh=51tksjZ4p3Jo6lHlpTnjaCw8OlIDI9Q9vdPpwuynACc=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=A2qNEQyQagmWPfNUKm4tQzqpZLxfP9wu1WvNlDUtjVackPiPVLKpLm9zQTSAQi1z+ye/OHfGDou6nd1e/KrBsJ9h8mqh6q4dv1uNd1ROzyTjVvoZUui8wm3xF5OVjHTP6iyoRbLEWpDD0fLyLPkaQYeghnaM8Mon13JmpQTab24= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=L3i5IMEX; 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="L3i5IMEX" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8CA7CC4CEC3; Wed, 18 Sep 2024 07:17:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1726643838; bh=51tksjZ4p3Jo6lHlpTnjaCw8OlIDI9Q9vdPpwuynACc=; h=From:To:Cc:Subject:Date:Reply-to:From; b=L3i5IMEX5FC+FjD1pOwhJzpqOYiNB2BBlxAcNBla599xbob6qCMzBpJYPanPtZnCN mQO/5CespqajPm75MDNyqpU0AScBjXpb0wzOF6Ic4q5Ybc8N2j8+LsaCfRAwGfjArd TlucwLKUvXqHP+G2pVfPAVbe2h9eODj5aD1FWxGc= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-46744: Squashfs: sanity check symbolic link size Date: Wed, 18 Sep 2024 09:16:39 +0200 Message-ID: <2024091836-CVE-2024-46744-451f@gregkh> X-Mailer: git-send-email 2.46.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=3208; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=51tksjZ4p3Jo6lHlpTnjaCw8OlIDI9Q9vdPpwuynACc=; b=owGbwMvMwCRo6H6F97bub03G02pJDGmv6kK22ryamJQ227LzwMS3Tp/sWDqW+9pN+HXGYHbR6 aibf1/Xd8SyMAgyMciKKbJ82cZzdH/FIUUvQ9vTMHNYmUCGMHBxCsBEbr5kmMWcYbLv7s4PZ/9f Et0/WYTL7WbI9a8M8yM9OZoDj+/WNPq9JfDJ1LU2FgvNtwIA 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: Squashfs: sanity check symbolic link size Syzkiller reports a "KMSAN: uninit-value in pick_link" bug. This is caused by an uninitialised page, which is ultimately caused by a corrupted symbolic link size read from disk. The reason why the corrupted symlink size causes an uninitialised page is due to the following sequence of events: 1. squashfs_read_inode() is called to read the symbolic link from disk. This assigns the corrupted value 3875536935 to inode->i_size. 2. Later squashfs_symlink_read_folio() is called, which assigns this corrupted value to the length variable, which being a signed int, overflows producing a negative number. 3. The following loop that fills in the page contents checks that the copied bytes is less than length, which being negative means the loop is skipped, producing an uninitialised page. This patch adds a sanity check which checks that the symbolic link size is not larger than expected. -- V2: fix spelling mistake. The Linux kernel CVE team has assigned CVE-2024-46744 to this issue. Affected and fixed versions =========================== Fixed in 4.19.322 with commit f82cb7f24032 Fixed in 5.4.284 with commit 1b9451ba6f21 Fixed in 5.10.226 with commit 5c8906de98d0 Fixed in 5.15.167 with commit 087f25b2d36a Fixed in 6.1.110 with commit fac5e82ab133 Fixed in 6.6.51 with commit c3af7e460a52 Fixed in 6.10.10 with commit ef4e249971eb Fixed in 6.11 with commit 810ee43d9cd2 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-46744 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: fs/squashfs/inode.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/f82cb7f24032ed023fc67d26ea9bf322d8431a90 https://git.kernel.org/stable/c/1b9451ba6f21478a75288ea3e3fca4be35e2a438 https://git.kernel.org/stable/c/5c8906de98d0d7ad42ff3edf2cb6cd7e0ea658c4 https://git.kernel.org/stable/c/087f25b2d36adae19951114ffcbb7106ed405ebb https://git.kernel.org/stable/c/fac5e82ab1334fc8ed6ff7183702df634bd1d93d https://git.kernel.org/stable/c/c3af7e460a526007e4bed1ce3623274a1a6afe5e https://git.kernel.org/stable/c/ef4e249971eb77ec33d74c5c3de1e2576faf6c90 https://git.kernel.org/stable/c/810ee43d9cd245d138a2733d87a24858a23f577d