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 360D9535AC for ; Fri, 15 Mar 2024 20:15:28 +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=1710533729; cv=none; b=INYSMNl+49psn4OEpWO0dyU2f2DF+Mx3rvdkhbnTNN24+9++FYmw+AVWRZJ5VhSNsg1HIujz4FYjMTcsxp4i4To6Z/sdJNdqI13aK+GM1ubxXvuqy5wZ5XmqPZT3jPNoP0weDM+19RTpPF6gT8RbFRj1JGijdoNTMWd9QLmaedo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710533729; c=relaxed/simple; bh=CIV8Orjqp+X/587p0w7c3vLDvuEQ7gBsjJq2Moicp5g=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=icrm9e7zht+sONOXaS7q6F/fZzkEPpudZBktrPx/gn8VB9EnlrLQgd2uwMq/X3AOrvFrUhPL74R/6z3Q0m5Vjw9AKeUTmCxVPeNshE39U/uvxUjc9YxGoABRB1cffUNqLv3FpHoRDzJ5Og+DMeEk2FcRmpRAg2JMGYsdG5n3r6s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=u5/sz9H9; 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="u5/sz9H9" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2035EC433F1; Fri, 15 Mar 2024 20:15:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1710533728; bh=CIV8Orjqp+X/587p0w7c3vLDvuEQ7gBsjJq2Moicp5g=; h=From:To:Cc:Subject:Date:Reply-to:From; b=u5/sz9H910YAKQdlE/6HhuTxUm3pEZ6j80fCJJWsf12XFP8cp7KpXbtvlNQvk7qnv cZVbW4jNHIDOhVt1c7Bdk9F8aHQEc7CcXv5OYwOQ4D+xltlnWSns1CWIpXTBJTcXeE w3pZmCZazpgIqFCVkKkmziMVt9gtxPds0Yvbjf6Q= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2021-47119: ext4: fix memory leak in ext4_fill_super Date: Fri, 15 Mar 2024 21:15:09 +0100 Message-ID: <2024031509-CVE-2021-47119-22d3@gregkh> X-Mailer: git-send-email 2.44.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=2684; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=CIV8Orjqp+X/587p0w7c3vLDvuEQ7gBsjJq2Moicp5g=; b=owGbwMvMwCRo6H6F97bub03G02pJDKlf1viq1myz0V33ZkNSxeen12pzNSIKXrSZK/JaOkhrX Vdi3WLaEcvCIMjEICumyPJlG8/R/RWHFL0MbU/DzGFlAhnCwMUpABO5mc8wz37JSvaOjSx26oZm GbuWZbVtneJ5hGG+S4Mjr9sSQa0fSjY50eHT7vL/PLQBAA== 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: ext4: fix memory leak in ext4_fill_super Buffer head references must be released before calling kill_bdev(); otherwise the buffer head (and its page referenced by b_data) will not be freed by kill_bdev, and subsequently that bh will be leaked. If blocksizes differ, sb_set_blocksize() will kill current buffers and page cache by using kill_bdev(). And then super block will be reread again but using correct blocksize this time. sb_set_blocksize() didn't fully free superblock page and buffer head, and being busy, they were not freed and instead leaked. This can easily be reproduced by calling an infinite loop of: systemctl start .mount, and systemctl stop .mount ... since systemd creates a cgroup for each slice which it mounts, and the bh leak get amplified by a dying memory cgroup that also never gets freed, and memory consumption is much more easily noticed. The Linux kernel CVE team has assigned CVE-2021-47119 to this issue. Affected and fixed versions =========================== Issue introduced in 2.6.19 with commit ac27a0ec112a and fixed in 5.10.43 with commit 01d349a481f0 Issue introduced in 2.6.19 with commit ac27a0ec112a and fixed in 5.12.10 with commit 1385b23396d5 Issue introduced in 2.6.19 with commit ac27a0ec112a and fixed in 5.13 with commit afd09b617db3 Please see https://www.kernel.org or 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-2021-47119 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/ext4/super.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/01d349a481f0591230300a9171330136f9159bcd https://git.kernel.org/stable/c/1385b23396d511d5233b8b921ac3058b3f86a5e1 https://git.kernel.org/stable/c/afd09b617db3786b6ef3dc43e28fe728cfea84df