]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ACPI: CPPC: Avoid out of bounds access when parsing _CPC data
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 22 Mar 2022 16:02:05 +0000 (17:02 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 12:06:52 +0000 (14:06 +0200)
commitb80b19b32a432c9eee1cd200ef7aaddf608f54d1
tree1018bc816a5a0186c6d161c6c48fecef7a3413bb
parentd64ac4ae0ea0c82f009bf48398a88764b4bce41c
ACPI: CPPC: Avoid out of bounds access when parsing _CPC data

commit 40d8abf364bcab23bc715a9221a3c8623956257b upstream.

If the NumEntries field in the _CPC return package is less than 2, do
not attempt to access the "Revision" element of that package, because
it may not be present then.

Fixes: 337aadff8e45 ("ACPI: Introduce CPU performance controls using CPPC")
BugLink: https://lore.kernel.org/lkml/20220322143534.GC32582@xsang-OptiPlex-9020/
Reported-by: kernel test robot <oliver.sang@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/acpi/cppc_acpi.c