From: Greg Kroah-Hartman Date: Fri, 2 Sep 2016 13:36:59 +0000 (+0200) Subject: 4.7-stable patches X-Git-Tag: v3.14.78~16 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f9ddd4c5acc68b1b3fc7f45e5151dc30930bf991;p=thirdparty%2Fkernel%2Fstable-queue.git 4.7-stable patches 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 --- 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 index 00000000000..f4f74d32015 --- /dev/null +++ b/queue-4.7/acpi-cppc-prevent-cpc_desc_ptr-points-to-the-invalid-data.patch @@ -0,0 +1,46 @@ +From 2324d15447a9db168b1f85e3feac635b1ff8edb8 Mon Sep 17 00:00:00 2001 +From: Hoan Tran +Date: Wed, 25 May 2016 12:09:23 -0700 +Subject: ACPI / CPPC: Prevent cpc_desc_ptr points to the invalid data + +From: Hoan Tran + +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 +Acked-by: Ashwin Chaugule +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Greg Kroah-Hartman + +--- + 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 index 00000000000..454336a887a --- /dev/null +++ b/queue-4.7/acpi-cppc-return-error-if-_cpc-is-invalid-on-a-cpu.patch @@ -0,0 +1,64 @@ +From 8343c40d3de32ebfe8f48b043964e4ba0e7701f7 Mon Sep 17 00:00:00 2001 +From: Hoan Tran +Date: Fri, 17 Jun 2016 15:16:31 -0700 +Subject: ACPI: CPPC: Return error if _CPC is invalid on a CPU + +From: Hoan Tran + +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 +Reviewed-by: Prashanth Prakash +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Greg Kroah-Hartman + +--- + 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) diff --git a/queue-4.7/series b/queue-4.7/series index 39956ad25a7..6b45eb1422c 100644 --- a/queue-4.7/series +++ b/queue-4.7/series @@ -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 index 00000000000..88d746f6bc3 --- /dev/null +++ b/queue-4.7/um-don-t-discard-.text.exit-section.patch @@ -0,0 +1,42 @@ +From dad2232844073295c64e9cc2d734a0ade043e0f6 Mon Sep 17 00:00:00 2001 +From: Andrey Ryabinin +Date: Wed, 17 Aug 2016 18:10:11 +0300 +Subject: um: Don't discard .text.exit section + +From: Andrey Ryabinin + +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 +Signed-off-by: Andrey Ryabinin +Acked-by: Dmitry Vyukov +Signed-off-by: Richard Weinberger +Signed-off-by: Greg Kroah-Hartman + +--- + 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 : {