diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-10-31 15:33:05 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-10-31 15:33:05 -0400 |
commit | 0f4b06766bb6dc16c62c45607e3ccced23b7fead (patch) | |
tree | 08a05241455d67e1f383ac5316a56b3ca8c23dc6 | |
parent | bcdfdaee5a0d914fe23220a297952b0c630f7130 (diff) | |
parent | 59aa896db80479dec29f471a7ca2b9eeeeb7d38e (diff) |
Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull timer fixes from Thomas Gleixner:
"As you requested in the rc2 release mail the timer department serves
you a few real bug fixes:
- Fix the probe logic of the architected arm/arm64 timer
- Plug a stack info leak in posix-timers
- Prevent a shift out of bounds issue in the clockevents core"
* 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
ARM/ARM64: arch-timer: fix arch_timer_probed logic
clockevents: Prevent shift out of bounds
posix-timers: Fix stack info leak in timer_create()
-rw-r--r-- | drivers/clocksource/arm_arch_timer.c | 6 | ||||
-rw-r--r-- | kernel/time/clockevents.c | 2 | ||||
-rw-r--r-- | kernel/time/posix-timers.c | 1 |
3 files changed, 5 insertions, 4 deletions
diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c index 2133f9d59d06..43005d4d3348 100644 --- a/drivers/clocksource/arm_arch_timer.c +++ b/drivers/clocksource/arm_arch_timer.c | |||
@@ -660,11 +660,11 @@ static bool __init | |||
660 | arch_timer_probed(int type, const struct of_device_id *matches) | 660 | arch_timer_probed(int type, const struct of_device_id *matches) |
661 | { | 661 | { |
662 | struct device_node *dn; | 662 | struct device_node *dn; |
663 | bool probed = false; | 663 | bool probed = true; |
664 | 664 | ||
665 | dn = of_find_matching_node(NULL, matches); | 665 | dn = of_find_matching_node(NULL, matches); |
666 | if (dn && of_device_is_available(dn) && (arch_timers_present & type)) | 666 | if (dn && of_device_is_available(dn) && !(arch_timers_present & type)) |
667 | probed = true; | 667 | probed = false; |
668 | of_node_put(dn); | 668 | of_node_put(dn); |
669 | 669 | ||
670 | return probed; | 670 | return probed; |
diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c index 9c94c19f1305..55449909f114 100644 --- a/kernel/time/clockevents.c +++ b/kernel/time/clockevents.c | |||
@@ -72,7 +72,7 @@ static u64 cev_delta2ns(unsigned long latch, struct clock_event_device *evt, | |||
72 | * Also omit the add if it would overflow the u64 boundary. | 72 | * Also omit the add if it would overflow the u64 boundary. |
73 | */ | 73 | */ |
74 | if ((~0ULL - clc > rnd) && | 74 | if ((~0ULL - clc > rnd) && |
75 | (!ismax || evt->mult <= (1U << evt->shift))) | 75 | (!ismax || evt->mult <= (1ULL << evt->shift))) |
76 | clc += rnd; | 76 | clc += rnd; |
77 | 77 | ||
78 | do_div(clc, evt->mult); | 78 | do_div(clc, evt->mult); |
diff --git a/kernel/time/posix-timers.c b/kernel/time/posix-timers.c index 42b463ad90f2..31ea01f42e1f 100644 --- a/kernel/time/posix-timers.c +++ b/kernel/time/posix-timers.c | |||
@@ -636,6 +636,7 @@ SYSCALL_DEFINE3(timer_create, const clockid_t, which_clock, | |||
636 | goto out; | 636 | goto out; |
637 | } | 637 | } |
638 | } else { | 638 | } else { |
639 | memset(&event.sigev_value, 0, sizeof(event.sigev_value)); | ||
639 | event.sigev_notify = SIGEV_SIGNAL; | 640 | event.sigev_notify = SIGEV_SIGNAL; |
640 | event.sigev_signo = SIGALRM; | 641 | event.sigev_signo = SIGALRM; |
641 | event.sigev_value.sival_int = new_timer->it_id; | 642 | event.sigev_value.sival_int = new_timer->it_id; |