]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.7-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 Sep 2016 13:36:59 +0000 (15:36 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 Sep 2016 13:36:59 +0000 (15:36 +0200)
added patches:
acpi-cppc-prevent-cpc_desc_ptr-points-to-the-invalid-data.patch
acpi-cppc-return-error-if-_cpc-is-invalid-on-a-cpu.patch
um-don-t-discard-.text.exit-section.patch

queue-4.7/acpi-cppc-prevent-cpc_desc_ptr-points-to-the-invalid-data.patch [new file with mode: 0644]
queue-4.7/acpi-cppc-return-error-if-_cpc-is-invalid-on-a-cpu.patch [new file with mode: 0644]
queue-4.7/series
queue-4.7/um-don-t-discard-.text.exit-section.patch [new file with mode: 0644]

diff --git a/queue-4.7/acpi-cppc-prevent-cpc_desc_ptr-points-to-the-invalid-data.patch b/queue-4.7/acpi-cppc-prevent-cpc_desc_ptr-points-to-the-invalid-data.patch
new file mode 100644 (file)
index 0000000..f4f74d3
--- /dev/null
@@ -0,0 +1,46 @@
+From 2324d15447a9db168b1f85e3feac635b1ff8edb8 Mon Sep 17 00:00:00 2001
+From: Hoan Tran <hotran@apm.com>
+Date: Wed, 25 May 2016 12:09:23 -0700
+Subject: ACPI / CPPC: Prevent cpc_desc_ptr points to the invalid data
+
+From: Hoan Tran <hotran@apm.com>
+
+commit 2324d15447a9db168b1f85e3feac635b1ff8edb8 upstream.
+
+When CPPC fails to request a PCC channel, the CPC data is freed
+and cpc_desc_ptr points to the invalid data.
+
+Avoid this issue by moving the cpc_desc_ptr assignment after the PCC
+channel request.
+
+Signed-off-by: Hoan Tran <hotran@apm.com>
+Acked-by: Ashwin Chaugule <ashwin.chaugule@linaro.org>
+Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/acpi/cppc_acpi.c |    6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+--- a/drivers/acpi/cppc_acpi.c
++++ b/drivers/acpi/cppc_acpi.c
+@@ -601,9 +601,6 @@ int acpi_cppc_processor_probe(struct acp
+       /* Store CPU Logical ID */
+       cpc_ptr->cpu_id = pr->id;
+-      /* Plug it into this CPUs CPC descriptor. */
+-      per_cpu(cpc_desc_ptr, pr->id) = cpc_ptr;
+-
+       /* Parse PSD data for this CPU */
+       ret = acpi_get_psd(cpc_ptr, handle);
+       if (ret)
+@@ -616,6 +613,9 @@ int acpi_cppc_processor_probe(struct acp
+                       goto out_free;
+       }
++      /* Plug PSD data into this CPUs CPC descriptor. */
++      per_cpu(cpc_desc_ptr, pr->id) = cpc_ptr;
++
+       /* Everything looks okay */
+       pr_debug("Parsed CPC struct for CPU: %d\n", pr->id);
diff --git a/queue-4.7/acpi-cppc-return-error-if-_cpc-is-invalid-on-a-cpu.patch b/queue-4.7/acpi-cppc-return-error-if-_cpc-is-invalid-on-a-cpu.patch
new file mode 100644 (file)
index 0000000..454336a
--- /dev/null
@@ -0,0 +1,64 @@
+From 8343c40d3de32ebfe8f48b043964e4ba0e7701f7 Mon Sep 17 00:00:00 2001
+From: Hoan Tran <hotran@apm.com>
+Date: Fri, 17 Jun 2016 15:16:31 -0700
+Subject: ACPI: CPPC: Return error if _CPC is invalid on a CPU
+
+From: Hoan Tran <hotran@apm.com>
+
+commit 8343c40d3de32ebfe8f48b043964e4ba0e7701f7 upstream.
+
+Based on 8.4.7.1 section of ACPI 6.1 specification, if the platform
+supports CPPC, the _CPC object must exist under all processor objects.
+If cpc_desc_ptr pointer is invalid on any CPUs, acpi_get_psd_map()
+should return error and CPPC cpufreq driver can not be registered.
+
+Signed-off-by: Hoan Tran <hotran@apm.com>
+Reviewed-by: Prashanth Prakash <pprakash@codeaurora.org>
+Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/acpi/cppc_acpi.c |   18 ++++++++++++------
+ 1 file changed, 12 insertions(+), 6 deletions(-)
+
+--- a/drivers/acpi/cppc_acpi.c
++++ b/drivers/acpi/cppc_acpi.c
+@@ -299,8 +299,10 @@ int acpi_get_psd_map(struct cpudata **al
+                       continue;
+               cpc_ptr = per_cpu(cpc_desc_ptr, i);
+-              if (!cpc_ptr)
+-                      continue;
++              if (!cpc_ptr) {
++                      retval = -EFAULT;
++                      goto err_ret;
++              }
+               pdomain = &(cpc_ptr->domain_info);
+               cpumask_set_cpu(i, pr->shared_cpu_map);
+@@ -322,8 +324,10 @@ int acpi_get_psd_map(struct cpudata **al
+                               continue;
+                       match_cpc_ptr = per_cpu(cpc_desc_ptr, j);
+-                      if (!match_cpc_ptr)
+-                              continue;
++                      if (!match_cpc_ptr) {
++                              retval = -EFAULT;
++                              goto err_ret;
++                      }
+                       match_pdomain = &(match_cpc_ptr->domain_info);
+                       if (match_pdomain->domain != pdomain->domain)
+@@ -353,8 +357,10 @@ int acpi_get_psd_map(struct cpudata **al
+                               continue;
+                       match_cpc_ptr = per_cpu(cpc_desc_ptr, j);
+-                      if (!match_cpc_ptr)
+-                              continue;
++                      if (!match_cpc_ptr) {
++                              retval = -EFAULT;
++                              goto err_ret;
++                      }
+                       match_pdomain = &(match_cpc_ptr->domain_info);
+                       if (match_pdomain->domain != pdomain->domain)
index 39956ad25a7c086fe31ae79bb5eabf009a369328..6b45eb1422c9fbf957512b2bff7abed7b11f5c59 100644 (file)
@@ -16,3 +16,6 @@ vfio-pci-fix-null-pointer-oops-in-error-interrupt-setup-handling.patch
 tracing-fix-tick_stop-tracepoint-symbols-for-user-export.patch
 perf-intel-pt-fix-occasional-decoding-errors-when-tracing-system-wide.patch
 libnvdimm-nd_blk-mask-off-reserved-status-bits.patch
+acpi-cppc-return-error-if-_cpc-is-invalid-on-a-cpu.patch
+acpi-cppc-prevent-cpc_desc_ptr-points-to-the-invalid-data.patch
+um-don-t-discard-.text.exit-section.patch
diff --git a/queue-4.7/um-don-t-discard-.text.exit-section.patch b/queue-4.7/um-don-t-discard-.text.exit-section.patch
new file mode 100644 (file)
index 0000000..88d746f
--- /dev/null
@@ -0,0 +1,42 @@
+From dad2232844073295c64e9cc2d734a0ade043e0f6 Mon Sep 17 00:00:00 2001
+From: Andrey Ryabinin <aryabinin@virtuozzo.com>
+Date: Wed, 17 Aug 2016 18:10:11 +0300
+Subject: um: Don't discard .text.exit section
+
+From: Andrey Ryabinin <aryabinin@virtuozzo.com>
+
+commit dad2232844073295c64e9cc2d734a0ade043e0f6 upstream.
+
+Commit e41f501d3912 ("vmlinux.lds: account for destructor sections")
+added '.text.exit' to EXIT_TEXT which is discarded at link time by default.
+This breaks compilation of UML:
+     `.text.exit' referenced in section `.fini_array' of
+     /usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/libc.a(sdlerror.o):
+     defined in discarded section `.text.exit' of
+     /usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/libc.a(sdlerror.o)
+
+Apparently UML doesn't want to discard exit text, so let's place all EXIT_TEXT
+sections in .exit.text.
+
+Fixes: e41f501d3912 ("vmlinux.lds: account for destructor sections")
+Reported-by: Stefan Traby <stefan@hello-penguin.com>
+Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
+Acked-by: Dmitry Vyukov <dvyukov@google.com>
+Signed-off-by: Richard Weinberger <richard@nod.at>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/um/include/asm/common.lds.S |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/arch/um/include/asm/common.lds.S
++++ b/arch/um/include/asm/common.lds.S
+@@ -81,7 +81,7 @@
+   .altinstr_replacement : { *(.altinstr_replacement) }
+   /* .exit.text is discard at runtime, not link time, to deal with references
+      from .altinstructions and .eh_frame */
+-  .exit.text : { *(.exit.text) }
++  .exit.text : { EXIT_TEXT }
+   .exit.data : { *(.exit.data) }
+   .preinit_array : {