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 EDC553CD8C9 for ; Mon, 13 Apr 2026 13:41:22 +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=1776087683; cv=none; b=fSfJavttu0gMASXJ00rnNRB6b/KT54pIerAN9/P7SchwuBT135WF86gNv0+7sGynNxzl8pfECGA/85rF0/Rd5FdXudtwc5/ySMfWWFIS7M713xiXy6hJ/RBSgTgI050uAZ0u4MO4f7+2wapPIvmO3a6fl9umKHer9u3iJMbTYpA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776087683; c=relaxed/simple; bh=z28BFqU9wLyoKxxthkr6Uyq3u4wCLq5J8bKw8F4eT5Y=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=vFA9dH9+hiy/pDCONs/rqKAiLQoslkefyEwWrJ5y6qol04IH5KeFBtr5mjxk/HD5SQ5qlPBy90LbaCckbZRuUTjw4x6O5oEl4ESaHVSKizxKDBIAWxWwnPn9yPAgclQ7wZ30MSzvhCqYbwSA9ORfZ3zEw4Q9DUe+pm2Jr5YalcA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=KOYsjf0g; 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="KOYsjf0g" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 756D1C2BCB5; Mon, 13 Apr 2026 13:41:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1776087682; bh=z28BFqU9wLyoKxxthkr6Uyq3u4wCLq5J8bKw8F4eT5Y=; h=From:To:Cc:Subject:Date:Reply-To:From; b=KOYsjf0gueSPGJ/Pz4Kau8WQIBD+pOv3z9CNyXS6c7gRm0xzGTuob/FYcqNFc9O57 coDDNWSznC1CjCtyc2n/AJX42po+xuG9SSXJsyRScQ3O3biS4Stkn+3iikpHi8lIkg OsjIgbKZuLW188Hf1xmn1yORUKAPqGLEbaadYDdU= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-31426: ACPI: EC: clean up handlers on probe failure in acpi_ec_setup() Date: Mon, 13 Apr 2026 15:41:00 +0200 Message-ID: <2026041357-CVE-2026-31426-bfb3@gregkh> X-Mailer: git-send-email 2.53.0 Reply-To: , Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=4746; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=lnIrk6ulhwe005NTbCKOZqjeEM3ePEjJ2R8JPLNQEZY=; b=owGbwMvMwCRo6H6F97bub03G02pJDJl3PmXefdz3/ObyvT8v/1pyzGHJpPWrTiqvTLouUtwuG pZ3+dQ9w45YFgZBJgZZMUWWL9t4ju6vOKToZWh7GmYOKxPIEAYuTgGYSIcIw4Lz0YKij/5sfLbw ztTaDaH6345WzNBkmJ8sHfpuadGbKXmXrwTdNhDTKcnY+RYA X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: ACPI: EC: clean up handlers on probe failure in acpi_ec_setup() When ec_install_handlers() returns -EPROBE_DEFER on reduced-hardware platforms, it has already started the EC and installed the address space handler with the struct acpi_ec pointer as handler context. However, acpi_ec_setup() propagates the error without any cleanup. The caller acpi_ec_add() then frees the struct acpi_ec for non-boot instances, leaving a dangling handler context in ACPICA. Any subsequent AML evaluation that accesses an EC OpRegion field dispatches into acpi_ec_space_handler() with the freed pointer, causing a use-after-free: BUG: KASAN: slab-use-after-free in mutex_lock (kernel/locking/mutex.c:289) Write of size 8 at addr ffff88800721de38 by task init/1 Call Trace: mutex_lock (kernel/locking/mutex.c:289) acpi_ec_space_handler (drivers/acpi/ec.c:1362) acpi_ev_address_space_dispatch (drivers/acpi/acpica/evregion.c:293) acpi_ex_access_region (drivers/acpi/acpica/exfldio.c:246) acpi_ex_field_datum_io (drivers/acpi/acpica/exfldio.c:509) acpi_ex_extract_from_field (drivers/acpi/acpica/exfldio.c:700) acpi_ex_read_data_from_field (drivers/acpi/acpica/exfield.c:327) acpi_ex_resolve_node_to_value (drivers/acpi/acpica/exresolv.c:392) Allocated by task 1: acpi_ec_alloc (drivers/acpi/ec.c:1424) acpi_ec_add (drivers/acpi/ec.c:1692) Freed by task 1: kfree (mm/slub.c:6876) acpi_ec_add (drivers/acpi/ec.c:1751) The bug triggers on reduced-hardware EC platforms (ec->gpe < 0) when the GPIO IRQ provider defers probing. Once the stale handler exists, any unprivileged sysfs read that causes AML to touch an EC OpRegion (battery, thermal, backlight) exercises the dangling pointer. Fix this by calling ec_remove_handlers() in the error path of acpi_ec_setup() before clearing first_ec. ec_remove_handlers() checks each EC_FLAGS_* bit before acting, so it is safe to call regardless of how far ec_install_handlers() progressed: -ENODEV (handler not installed): only calls acpi_ec_stop() -EPROBE_DEFER (handler installed): removes handler, stops EC The Linux kernel CVE team has assigned CVE-2026-31426 to this issue. Affected and fixed versions =========================== Issue introduced in 5.7 with commit 03e9a0e05739cf872fee494b06c75c0469704a21 and fixed in 6.1.168 with commit 022d1727f33ff90b3e1775125264e3023901952e Issue introduced in 5.7 with commit 03e9a0e05739cf872fee494b06c75c0469704a21 and fixed in 6.6.131 with commit 9c886e63b69658959633937e3acb7ca8addf7499 Issue introduced in 5.7 with commit 03e9a0e05739cf872fee494b06c75c0469704a21 and fixed in 6.12.80 with commit 808c0f156f48d5b8ca34088cbbfba8444e606cbc Issue introduced in 5.7 with commit 03e9a0e05739cf872fee494b06c75c0469704a21 and fixed in 6.18.21 with commit d04c007047c88158141d9bd5eac761cdadd3782c Issue introduced in 5.7 with commit 03e9a0e05739cf872fee494b06c75c0469704a21 and fixed in 6.19.11 with commit be1a827e15991e874e0d5222d0ea5fdad01960fe Issue introduced in 5.7 with commit 03e9a0e05739cf872fee494b06c75c0469704a21 and fixed in 7.0 with commit f6484cadbcaf26b5844b51bd7307a663dda48ef6 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-2026-31426 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/acpi/ec.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/022d1727f33ff90b3e1775125264e3023901952e https://git.kernel.org/stable/c/9c886e63b69658959633937e3acb7ca8addf7499 https://git.kernel.org/stable/c/808c0f156f48d5b8ca34088cbbfba8444e606cbc https://git.kernel.org/stable/c/d04c007047c88158141d9bd5eac761cdadd3782c https://git.kernel.org/stable/c/be1a827e15991e874e0d5222d0ea5fdad01960fe https://git.kernel.org/stable/c/f6484cadbcaf26b5844b51bd7307a663dda48ef6