Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'timers-urgent-2020-04-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull timer fixes from Thomas Gleixner:
"Two timer subsystem fixes:

- Prevent a use after free in the new lockdep state tracking for
hrtimers

- Add missing parenthesis in the VF pit timer driver"

* tag 'timers-urgent-2020-04-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
clocksource/drivers/timer-vf-pit: Add missing parenthesis
hrtimer: Don't dereference the hrtimer pointer after the callback

+19 -13
+1 -1
drivers/clocksource/timer-vf-pit.c
··· 129 129 __raw_writel(PITTFLG_TIF, clkevt_base + PITTFLG); 130 130 131 131 BUG_ON(request_irq(irq, pit_timer_interrupt, IRQF_TIMER | IRQF_IRQPOLL, 132 - "VF pit timer", &clockevent_pit); 132 + "VF pit timer", &clockevent_pit)); 133 133 134 134 clockevent_pit.cpumask = cpumask_of(0); 135 135 clockevent_pit.irq = irq;
+15 -10
include/linux/irqflags.h
··· 58 58 } while (0) 59 59 60 60 # define lockdep_hrtimer_enter(__hrtimer) \ 61 - do { \ 62 - if (!__hrtimer->is_hard) \ 63 - current->irq_config = 1; \ 64 - } while (0) 61 + ({ \ 62 + bool __expires_hardirq = true; \ 63 + \ 64 + if (!__hrtimer->is_hard) { \ 65 + current->irq_config = 1; \ 66 + __expires_hardirq = false; \ 67 + } \ 68 + __expires_hardirq; \ 69 + }) 65 70 66 - # define lockdep_hrtimer_exit(__hrtimer) \ 67 - do { \ 68 - if (!__hrtimer->is_hard) \ 71 + # define lockdep_hrtimer_exit(__expires_hardirq) \ 72 + do { \ 73 + if (!__expires_hardirq) \ 69 74 current->irq_config = 0; \ 70 - } while (0) 75 + } while (0) 71 76 72 77 # define lockdep_posixtimer_enter() \ 73 78 do { \ ··· 107 102 # define lockdep_hardirq_exit() do { } while (0) 108 103 # define lockdep_softirq_enter() do { } while (0) 109 104 # define lockdep_softirq_exit() do { } while (0) 110 - # define lockdep_hrtimer_enter(__hrtimer) do { } while (0) 111 - # define lockdep_hrtimer_exit(__hrtimer) do { } while (0) 105 + # define lockdep_hrtimer_enter(__hrtimer) false 106 + # define lockdep_hrtimer_exit(__context) do { } while (0) 112 107 # define lockdep_posixtimer_enter() do { } while (0) 113 108 # define lockdep_posixtimer_exit() do { } while (0) 114 109 # define lockdep_irq_work_enter(__work) do { } while (0)
+3 -2
kernel/time/hrtimer.c
··· 1480 1480 unsigned long flags) __must_hold(&cpu_base->lock) 1481 1481 { 1482 1482 enum hrtimer_restart (*fn)(struct hrtimer *); 1483 + bool expires_in_hardirq; 1483 1484 int restart; 1484 1485 1485 1486 lockdep_assert_held(&cpu_base->lock); ··· 1515 1514 */ 1516 1515 raw_spin_unlock_irqrestore(&cpu_base->lock, flags); 1517 1516 trace_hrtimer_expire_entry(timer, now); 1518 - lockdep_hrtimer_enter(timer); 1517 + expires_in_hardirq = lockdep_hrtimer_enter(timer); 1519 1518 1520 1519 restart = fn(timer); 1521 1520 1522 - lockdep_hrtimer_exit(timer); 1521 + lockdep_hrtimer_exit(expires_in_hardirq); 1523 1522 trace_hrtimer_expire_exit(timer); 1524 1523 raw_spin_lock_irq(&cpu_base->lock); 1525 1524