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 D9C67187562 for ; Thu, 30 May 2024 15:30:52 +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=1717083052; cv=none; b=rHpqOz4NLlSbc4/WtbEewFdP23+T9S0Q8/6oNYnUNPVo51j+NrE0GrJ4bb/JgATuWmAQBleAd7ARrdSsyRr5VA/B+AVkzZsA6csTrRqm8X6K1IL9vY7cAT18+8q8tirVGGWSbq7vw19wHSh9qpIrIg61ulSRAvLSdAvU2YlhTjs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717083052; c=relaxed/simple; bh=laoD5wMHiqmLxiJJL1T24Wb8zpZ0PwJ7gW6o7lgSiHw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Q92z8AUmcOo7ZzGBQiIot4lbyvWjH8Yxz9r4hq17vnwSfIPQaHptEP5BinDRJ+kG2czjXTDQhxKKRi1RxJDI7PaoZh76/HnwZZsoqkte5u0TwQEgDyCBSqQxUpbgY8hgLjKBIFeddT4SsmlEg2PRRCRFeA7JU1i79RQId57zpo0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=APILVw4T; 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="APILVw4T" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1F3C7C2BBFC; Thu, 30 May 2024 15:30:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1717083052; bh=laoD5wMHiqmLxiJJL1T24Wb8zpZ0PwJ7gW6o7lgSiHw=; h=From:To:Cc:Subject:Date:Reply-to:From; b=APILVw4Ty7NOl+vMPZkMQAd30YmJjWkOj58aIeLbqPsPt8NcID4xiY11+SfYl0USv DfO9GQblOfPzzyY6sMK6UJBttlf6ey6HUzQn3Au73ZtJot6CG3jU28dpWmgZPkfC1L k9tuXRq/UtKaBBUha5Wj8x48FHX/r13t6PzlDf5k= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-36936: efi/unaccepted: touch soft lockup during memory accept Date: Thu, 30 May 2024 17:29:28 +0200 Message-ID: <2024053042-CVE-2024-36936-3116@gregkh> X-Mailer: git-send-email 2.45.1 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=3475; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=laoD5wMHiqmLxiJJL1T24Wb8zpZ0PwJ7gW6o7lgSiHw=; b=owGbwMvMwCRo6H6F97bub03G02pJDGkRs7WKuq5ytvgX+H1p8jI9clXE43SC1pGt/cJ8TMfiv Q45bHftiGVhEGRikBVTZPmyjefo/opDil6Gtqdh5rAygQxh4OIUgIl07GeYp1738VliWK9nDHfN 2Y+Zrt3nUyZOYJjvdmR358lT2y/XPl+rxr7BTdpK8HQ1AA== 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: efi/unaccepted: touch soft lockup during memory accept Commit 50e782a86c98 ("efi/unaccepted: Fix soft lockups caused by parallel memory acceptance") has released the spinlock so other CPUs can do memory acceptance in parallel and not triggers softlockup on other CPUs. However the softlock up was intermittent shown up if the memory of the TD guest is large, and the timeout of softlockup is set to 1 second: RIP: 0010:_raw_spin_unlock_irqrestore Call Trace: ? __hrtimer_run_queues ? hrtimer_interrupt ? watchdog_timer_fn ? __sysvec_apic_timer_interrupt ? __pfx_watchdog_timer_fn ? sysvec_apic_timer_interrupt ? __hrtimer_run_queues ? hrtimer_interrupt ? asm_sysvec_apic_timer_interrupt ? _raw_spin_unlock_irqrestore ? __sysvec_apic_timer_interrupt ? sysvec_apic_timer_interrupt accept_memory try_to_accept_memory do_huge_pmd_anonymous_page get_page_from_freelist __handle_mm_fault __alloc_pages __folio_alloc ? __tdx_hypercall handle_mm_fault vma_alloc_folio do_user_addr_fault do_huge_pmd_anonymous_page exc_page_fault ? __do_huge_pmd_anonymous_page asm_exc_page_fault __handle_mm_fault When the local irq is enabled at the end of accept_memory(), the softlockup detects that the watchdog on single CPU has not been fed for a while. That is to say, even other CPUs will not be blocked by spinlock, the current CPU might be stunk with local irq disabled for a while, which hurts not only nmi watchdog but also softlockup. Chao Gao pointed out that the memory accept could be time costly and there was similar report before. Thus to avoid any softlocup detection during this stage, give the softlockup a flag to skip the timeout check at the end of accept_memory(), by invoking touch_softlockup_watchdog(). The Linux kernel CVE team has assigned CVE-2024-36936 to this issue. Affected and fixed versions =========================== Issue introduced in 6.6 with commit 50e782a86c98 and fixed in 6.8.10 with commit 781e34b73601 Issue introduced in 6.6 with commit 50e782a86c98 and fixed in 6.9 with commit 1c5a1627f481 Issue introduced in 6.5.9 with commit b583bfcc5a36 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-36936 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/firmware/efi/unaccepted_memory.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/781e34b736014188ba9e46a71535237313dcda81 https://git.kernel.org/stable/c/1c5a1627f48105cbab81d25ec2f72232bfaa8185