1
0
Fork 0

ACPI fixes for v4.12-rc4

- Revert one more commit related to the ACPI-based handling of
    laptop lids that changed the default behavior on laptops that
    booted with closed lids and introduced a regression there
    (Benjamin Tissoires).
 
  - Add a missing acpi_put_table() to the code implementing the
    /sys/firmware/acpi/tables interface to prevent a counter in
    the ACPICA core from overflowing (Dan Williams).
 
  - Drop error messages printed by ACPICA on acpi_get_table()
    reference counting mismatches as they need not indicate real
    errors at this point (Lv Zheng).
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQIcBAABCAAGBQJZMeW9AAoJEILEb/54YlRx4B0P/R4z8QpaYtHRCJmjl4wULRJU
 GQ3YYar4GSS5dROIsGj9KF2hD9JikeQxmf/E3qJSZrwVVlDOJzFAsi6hWSBBRDv4
 u0FhgNRUV6x84TMOTk1KauH8Ucb9oJReDpjZcbrIXgGX3CfE0K9YrXX9gfXn4ITp
 gIF9wW3OjXNy5E4YqHB9MoPJ8TSD4qBJUJUYS23igZOsT1fxV8KkcSLmrUk2znMB
 J7uOVA9rzmih+nilnH1PyEVm/p3C9nflqhjZPc2oKAdFWj+3WLHdAoCRgmIkOFk4
 RVZm4iRsv0a9ONwFvi7ALsUJWS8oAfcIq1W4qC4D1xgSIIU0vXVKtKpDeYPWrL/W
 gXuduT3yAvLAePqw24PFABkKbhSgxyd7Y90uTlOHAvSW3deFlOYLPXsCo7uRp9X1
 MrZzy3gzZRIZeYSYM31OpawnPeTkyPX5vG//+rAlWBa7kW07emSob7DYUKb0At/5
 9uFVQVmRjTtA6cVPVz5oaZknTGJkF3k6OmyG38zy7FMBMhqdiRFD4myQXuarnuVs
 /3gl7LfNVHXuNiIg2oAoKujJ9hABWvtIYT1dCoW1KY6/LQyz6BmJVOLOQ483YUAB
 SWuNfKVnRn8zYp4isYaJinLqPF7OORwB1zBPKpoPgZV+n/30blxLpGj5kYx492mt
 Oi8JrydZeAvK3FAz34oO
 =5CiR
 -----END PGP SIGNATURE-----

Merge tag 'acpi-4.12-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull ACPI fixes from Rafael Wysocki:
 "These revert one more problematic commit related to the ACPI-based
  handling of laptop lids and make some unuseful error messages coming
  from ACPICA go away.

  Specifics:

   - Revert one more commit related to the ACPI-based handling of laptop
     lids that changed the default behavior on laptops that booted with
     closed lids and introduced a regression there (Benjamin Tissoires).

   - Add a missing acpi_put_table() to the code implementing the
     /sys/firmware/acpi/tables interface to prevent a counter in the
     ACPICA core from overflowing (Dan Williams).

   - Drop error messages printed by ACPICA on acpi_get_table() reference
     counting mismatches as they need not indicate real errors at this
     point (Lv Zheng)"

* tag 'acpi-4.12-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  ACPICA: Tables: Fix regression introduced by a too early mechanism enabling
  Revert "ACPI / button: Change default behavior to lid_init_state=open"
  ACPI / sysfs: fix acpi_get_table() leak / acpi-sysfs denial of service
hifive-unleashed-5.1
Linus Torvalds 2017-06-02 16:36:23 -07:00
commit 104c08ba8e
3 changed files with 6 additions and 7 deletions

View File

@ -418,11 +418,7 @@ acpi_tb_get_table(struct acpi_table_desc *table_desc,
table_desc->validation_count++;
if (table_desc->validation_count == 0) {
ACPI_ERROR((AE_INFO,
"Table %p, Validation count is zero after increment\n",
table_desc));
table_desc->validation_count--;
return_ACPI_STATUS(AE_LIMIT);
}
*out_table = table_desc->pointer;

View File

@ -113,7 +113,7 @@ struct acpi_button {
static BLOCKING_NOTIFIER_HEAD(acpi_lid_notifier);
static struct acpi_device *lid_device;
static u8 lid_init_state = ACPI_BUTTON_LID_INIT_OPEN;
static u8 lid_init_state = ACPI_BUTTON_LID_INIT_METHOD;
static unsigned long lid_report_interval __read_mostly = 500;
module_param(lid_report_interval, ulong, 0644);

View File

@ -333,14 +333,17 @@ static ssize_t acpi_table_show(struct file *filp, struct kobject *kobj,
container_of(bin_attr, struct acpi_table_attr, attr);
struct acpi_table_header *table_header = NULL;
acpi_status status;
ssize_t rc;
status = acpi_get_table(table_attr->name, table_attr->instance,
&table_header);
if (ACPI_FAILURE(status))
return -ENODEV;
return memory_read_from_buffer(buf, count, &offset,
table_header, table_header->length);
rc = memory_read_from_buffer(buf, count, &offset, table_header,
table_header->length);
acpi_put_table(table_header);
return rc;
}
static int acpi_table_attr_init(struct kobject *tables_obj,