0070-x86-platform-UV-Convert-timers-to-use-timer_setup.patch 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
  2. From: Kees Cook <[email protected]>
  3. Date: Mon, 16 Oct 2017 16:22:31 -0700
  4. Subject: [PATCH] x86/platform/UV: Convert timers to use timer_setup()
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. CVE-2017-5754
  9. In preparation for unconditionally passing the struct timer_list pointer to
  10. all timer callbacks, switch to using the new timer_setup() and from_timer()
  11. to pass the timer pointer explicitly.
  12. Signed-off-by: Kees Cook <[email protected]>
  13. Signed-off-by: Thomas Gleixner <[email protected]>
  14. Cc: Dimitri Sivanich <[email protected]>
  15. Cc: Russ Anderson <[email protected]>
  16. Cc: Mike Travis <[email protected]>
  17. Link: https://lkml.kernel.org/r/20171016232231.GA100493@beast
  18. (cherry picked from commit 376f3bcebdc999cc737d9052109cc33b573b3a8b)
  19. Signed-off-by: Andy Whitcroft <[email protected]>
  20. Signed-off-by: Kleber Sacilotto de Souza <[email protected]>
  21. (cherry picked from commit 869cbd2b31024e70d574527b8c6851bf2ebbe483)
  22. Signed-off-by: Fabian Grünbichler <[email protected]>
  23. ---
  24. arch/x86/kernel/apic/x2apic_uv_x.c | 5 ++---
  25. 1 file changed, 2 insertions(+), 3 deletions(-)
  26. diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c
  27. index 0d57bb9079c9..c0b694810ff4 100644
  28. --- a/arch/x86/kernel/apic/x2apic_uv_x.c
  29. +++ b/arch/x86/kernel/apic/x2apic_uv_x.c
  30. @@ -920,9 +920,8 @@ static __init void uv_rtc_init(void)
  31. /*
  32. * percpu heartbeat timer
  33. */
  34. -static void uv_heartbeat(unsigned long ignored)
  35. +static void uv_heartbeat(struct timer_list *timer)
  36. {
  37. - struct timer_list *timer = &uv_scir_info->timer;
  38. unsigned char bits = uv_scir_info->state;
  39. /* Flip heartbeat bit: */
  40. @@ -947,7 +946,7 @@ static int uv_heartbeat_enable(unsigned int cpu)
  41. struct timer_list *timer = &uv_cpu_scir_info(cpu)->timer;
  42. uv_set_cpu_scir_bits(cpu, SCIR_CPU_HEARTBEAT|SCIR_CPU_ACTIVITY);
  43. - setup_pinned_timer(timer, uv_heartbeat, cpu);
  44. + timer_setup(timer, uv_heartbeat, TIMER_PINNED);
  45. timer->expires = jiffies + SCIR_CPU_HB_INTERVAL;
  46. add_timer_on(timer, cpu);
  47. uv_cpu_scir_info(cpu)->enabled = 1;
  48. --
  49. 2.14.2