From: Greg Kroah-Hartman Date: Sat, 26 Jul 2014 19:00:37 +0000 (-0700) Subject: 3.10-stable patches X-Git-Tag: v3.4.100~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6bf314f25cb9bbaceb2133488230833a9f83fd63;p=thirdparty%2Fkernel%2Fstable-queue.git 3.10-stable patches added patches: arc-implement-ptrace-ptrace_get_thread_area.patch sched-fix-possible-divide-by-zero-in-avg_atom-calculation.patch --- diff --git a/queue-3.10/arc-implement-ptrace-ptrace_get_thread_area.patch b/queue-3.10/arc-implement-ptrace-ptrace_get_thread_area.patch new file mode 100644 index 00000000000..44323f357bf --- /dev/null +++ b/queue-3.10/arc-implement-ptrace-ptrace_get_thread_area.patch @@ -0,0 +1,44 @@ +From a4b6cb735b25aa84a462a1985e3e43bebaf5beb4 Mon Sep 17 00:00:00 2001 +From: Anton Kolesov +Date: Fri, 20 Jun 2014 20:28:39 +0400 +Subject: ARC: Implement ptrace(PTRACE_GET_THREAD_AREA) + +From: Anton Kolesov + +commit a4b6cb735b25aa84a462a1985e3e43bebaf5beb4 upstream. + +This patch adds implementation of GET_THREAD_AREA ptrace request type. This +is required by GDB to debug NPTL applications. + +Signed-off-by: Anton Kolesov +Signed-off-by: Vineet Gupta +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arc/include/uapi/asm/ptrace.h | 1 + + arch/arc/kernel/ptrace.c | 4 ++++ + 2 files changed, 5 insertions(+) + +--- a/arch/arc/include/uapi/asm/ptrace.h ++++ b/arch/arc/include/uapi/asm/ptrace.h +@@ -11,6 +11,7 @@ + #ifndef _UAPI__ASM_ARC_PTRACE_H + #define _UAPI__ASM_ARC_PTRACE_H + ++#define PTRACE_GET_THREAD_AREA 25 + + #ifndef __ASSEMBLY__ + /* +--- a/arch/arc/kernel/ptrace.c ++++ b/arch/arc/kernel/ptrace.c +@@ -136,6 +136,10 @@ long arch_ptrace(struct task_struct *chi + pr_debug("REQ=%ld: ADDR =0x%lx, DATA=0x%lx)\n", request, addr, data); + + switch (request) { ++ case PTRACE_GET_THREAD_AREA: ++ ret = put_user(task_thread_info(child)->thr_ptr, ++ (unsigned long __user *)data); ++ break; + default: + ret = ptrace_request(child, request, addr, data); + break; diff --git a/queue-3.10/sched-fix-possible-divide-by-zero-in-avg_atom-calculation.patch b/queue-3.10/sched-fix-possible-divide-by-zero-in-avg_atom-calculation.patch new file mode 100644 index 00000000000..eac858cf8c6 --- /dev/null +++ b/queue-3.10/sched-fix-possible-divide-by-zero-in-avg_atom-calculation.patch @@ -0,0 +1,44 @@ +From b0ab99e7736af88b8ac1b7ae50ea287fffa2badc Mon Sep 17 00:00:00 2001 +From: Mateusz Guzik +Date: Sat, 14 Jun 2014 15:00:09 +0200 +Subject: sched: Fix possible divide by zero in avg_atom() calculation + +From: Mateusz Guzik + +commit b0ab99e7736af88b8ac1b7ae50ea287fffa2badc upstream. + +proc_sched_show_task() does: + + if (nr_switches) + do_div(avg_atom, nr_switches); + +nr_switches is unsigned long and do_div truncates it to 32 bits, which +means it can test non-zero on e.g. x86-64 and be truncated to zero for +division. + +Fix the problem by using div64_ul() instead. + +As a side effect calculations of avg_atom for big nr_switches are now correct. + +Signed-off-by: Mateusz Guzik +Signed-off-by: Peter Zijlstra +Cc: Linus Torvalds +Link: http://lkml.kernel.org/r/1402750809-31991-1-git-send-email-mguzik@redhat.com +Signed-off-by: Ingo Molnar +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/sched/debug.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/kernel/sched/debug.c ++++ b/kernel/sched/debug.c +@@ -551,7 +551,7 @@ void proc_sched_show_task(struct task_st + + avg_atom = p->se.sum_exec_runtime; + if (nr_switches) +- do_div(avg_atom, nr_switches); ++ avg_atom = div64_ul(avg_atom, nr_switches); + else + avg_atom = -1LL; + diff --git a/queue-3.10/series b/queue-3.10/series index 2d3440b5039..93a444f4f87 100644 --- a/queue-3.10/series +++ b/queue-3.10/series @@ -52,3 +52,5 @@ dm-thin-metadata-do-not-allow-the-data-block-size-to-change.patch dm-cache-metadata-do-not-allow-the-data-block-size-to-change.patch pm-sleep-fix-request_firmware-error-at-resume.patch locking-mutex-disable-optimistic-spinning-on-some-architectures.patch +sched-fix-possible-divide-by-zero-in-avg_atom-calculation.patch +arc-implement-ptrace-ptrace_get_thread_area.patch