Files
Centos-kernel-stream-10/drivers/platform
CKI KWF Bot 4b645a67cf Merge: platform/x86: intel-hid: Protect ACPI notify handler against recursion
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10/-/merge_requests/2976

JIRA: https://redhat.atlassian.net/browse/RHEL-213294

commit c085d82613d5618814b84406c8b2d64f1bc305e7
Author: HyeongJun An <sammiee5311@gmail.com>
Date:   Sat Jun 6 02:49:05 2026 +0900

    platform/x86: intel-hid: Protect ACPI notify handler against recursion

    Since commit e2ffcda162 ("ACPI: OSL: Allow Notify () handlers to run on
    all CPUs") ACPI notify handlers like the intel-hid notify_handler() may
    run on multiple CPU cores racing with themselves.

    On convertibles and detachables (matched by DMI chassis-type 31 and 32 in
    dmi_auto_add_switch[]) the SW_TABLET_MODE input device is registered
    lazily from notify_handler() on the first tablet-mode event, via
    intel_hid_switches_setup(). When two such events race on different CPUs
    both can pass the !priv->switches check and register the priv->switches
    input device twice, resulting in a duplicate sysfs entry and a subsequent
    NULL pointer dereference.

    This is the same class of bug fixed by commit e075c3b13a ("platform/x86:
    intel-vbtn: Protect ACPI notify handler against recursion") for the
    sibling intel-vbtn driver.

    Protect intel-hid notify_handler() from racing with itself with a mutex
    to fix this.

    Fixes: e2ffcda162 ("ACPI: OSL: Allow Notify () handlers to run on all CPUs")
    Cc: stable@vger.kernel.org
    Signed-off-by: HyeongJun An <sammiee5311@gmail.com>
    Link: https://patch.msgid.link/20260605174905.131095-1-sammiee5311@gmail.com
    Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
    Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

Signed-off-by: Steve Best <sbest@redhat.com>

Approved-by: Tony Camuso <tcamuso@redhat.com>
Approved-by: David Arcari <darcari@redhat.com>
Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com>

Merged-by: CKI GitLab Kmaint Pipeline Bot <26919896-cki-kmaint-pipeline-bot@users.noreply.gitlab.com>
2026-07-29 20:28:33 +00:00
..