OSDN Git Service

drm/i915: Fix invalid access to ACPI _DSM objects
authorTakashi Iwai <tiwai@suse.de>
Fri, 2 Apr 2021 08:23:17 +0000 (10:23 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 7 Apr 2021 21:00:24 +0000 (00:00 +0300)
commit337d7a1621c7f02af867229990ac67c97da1b53a
tree9fa5f0fa385c3956728b0a5f666a35b4c2dee5aa
parent11cda4967a33003dc19e90f5df3470031a864d8d
drm/i915: Fix invalid access to ACPI _DSM objects

intel_dsm_platform_mux_info() tries to parse the ACPI package data
from _DSM for the debug information, but it assumes the fixed format
without checking what values are stored in the elements actually.
When an unexpected value is returned from BIOS, it may lead to GPF or
NULL dereference, as reported recently.

Add the checks of the contents in the returned values and skip the
values for invalid cases.

v1->v2: Check the info contents before dereferencing, too

BugLink: http://bugzilla.opensuse.org/show_bug.cgi?id=1184074
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210402082317.871-1-tiwai@suse.de
drivers/gpu/drm/i915/display/intel_acpi.c