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 51C9F1EE032 for ; Mon, 21 Oct 2024 18:02:38 +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=1729533758; cv=none; b=OXbc3xI4k9m5MXjfsbfW9dl0NdRbSL4VkOAw8P25ZQiTxf5lJoKZ0+yw6WkkawhWrq8+Wsgwt/Le/DNrgd504zX8sbbolWZCShzIOGatgDuaTAlD1RNEMHPOzR7R1Fk0mLYXYPC2EBdLCpfYVsRENdoMHWxfg38KRyJYTSePYas= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729533758; c=relaxed/simple; bh=yDuSvT9C4mYjIRmWYuD/y2cU+gDWivKMya2Vn0hlu4o=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Yx5jgKkeh6uCGnoWk7e3rqdJBCcc+j6wl5fdJBR13PWnWGCmLYz824h8a5+/fxlT3TEYnXqmUi7VgTpiNVR/HbcY6wk1SK/Rd+4HvuBkazKu4FXBNTWI8BL95ltawaPpdXEnmzM+DVpEEus/tiNHclWcrXHv+BlUuuKjm2HZg3w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=xPOyWhqR; 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="xPOyWhqR" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CD26EC4CEE5; Mon, 21 Oct 2024 18:02:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1729533758; bh=yDuSvT9C4mYjIRmWYuD/y2cU+gDWivKMya2Vn0hlu4o=; h=From:To:Cc:Subject:Date:Reply-to:From; b=xPOyWhqRPeVIY//8qqSSRbfsXb0TIz80QG6HGdE+NWnda8HlBYU6MrYILdHdlfrWT sEeo6RnPzAVHymb4kCawIxedyT1m5Lg+Q7hD/tBy4DQzVO/S13o3NXcaPHsTYcafpU FyuAZH7IEKfNkVg0NgujmStp6hFk8vH59GidplE0= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-49872: mm/gup: fix memfd_pin_folios alloc race panic Date: Mon, 21 Oct 2024 20:01:20 +0200 Message-ID: <2024102114-CVE-2024-49872-16d4@gregkh> X-Mailer: git-send-email 2.47.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=2125; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=yDuSvT9C4mYjIRmWYuD/y2cU+gDWivKMya2Vn0hlu4o=; b=owGbwMvMwCRo6H6F97bub03G02pJDOli015lreM9ma+8e+ql2629kzasP7dj8n/+26r8lQpNR 7gbN03/2hHLwiDIxCArpsjyZRvP0f0VhxS9DG1Pw8xhZQIZwsDFKQATUf3MsKB3rZ1FjrRf2fwz TRNaowQSI28bRDPMj1opksv5f0XSi8/+61ar3rM40y4lDgA= 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/gup: fix memfd_pin_folios alloc race panic If memfd_pin_folios tries to create a hugetlb page, but someone else already did, then folio gets the value -EEXIST here: folio = memfd_alloc_folio(memfd, start_idx); if (IS_ERR(folio)) { ret = PTR_ERR(folio); if (ret != -EEXIST) goto err; then on the next trip through the "while start_idx" loop we panic here: if (folio) { folio_put(folio); To fix, set the folio to NULL on error. The Linux kernel CVE team has assigned CVE-2024-49872 to this issue. Affected and fixed versions =========================== Issue introduced in 6.11 with commit 89c1905d9c14 and fixed in 6.11.3 with commit e28f39b359c0 Issue introduced in 6.11 with commit 89c1905d9c14 and fixed in 6.12-rc1 with commit ce645b9fdc78 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-49872 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/gup.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/e28f39b359c0cfdcc011603e51187085a5f1e5e3 https://git.kernel.org/stable/c/ce645b9fdc78ec5d28067286e92871ddae6817d5