ACPI: sysfs: validate return type of _STR method
authorThomas Weißschuh <linux@weissschuh.net>
Tue, 9 Jul 2024 20:37:24 +0000 (22:37 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 2 Aug 2024 14:44:22 +0000 (16:44 +0200)
commit4bb1e7d027413835b086aed35bc3f0713bc0f72b
treeecaab6e92dd5b05c106bb2bad7bda5e2934df5e9
parent8400291e289ee6b2bf9779ff1c83a291501f017b
ACPI: sysfs: validate return type of _STR method

Only buffer objects are valid return values of _STR.

If something else is returned description_show() will access invalid
memory.

Fixes: d1efe3c324ea ("ACPI: Add new sysfs interface to export device description")
Cc: All applicable <stable@vger.kernel.org>
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Link: https://patch.msgid.link/20240709-acpi-sysfs-groups-v2-1-058ab0667fa8@weissschuh.net
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/device_sysfs.c