Re: [linux-stable] 4fc2942b6e kernel BUG at kernel/time/hrtimer.c:109!
On Fri, Feb 17, 2017 at 10:09:06AM +, Marc Zyngier wrote: On 17/02/17 09:28, Thomas Gleixner wrote: On Fri, 17 Feb 2017, kernel test robot wrote: Hi Marc, We find this oops in linux-4.4.y. The gcc-6 compiled mainline kernel is fine. The last bit is worrying, as mainline has the exact same bug. Has it been tested the same way? Nope, mainline is not tested the same way because gcc-4.6 cannot build a mainline kernel due to gcc-plugin related build errors. Thanks, Fengguang
Re: [linux-stable] 4fc2942b6e kernel BUG at kernel/time/hrtimer.c:109!
On 17/02/17 10:16, Thomas Gleixner wrote: > On Fri, 17 Feb 2017, Marc Zyngier wrote: > >> On 17/02/17 09:28, Thomas Gleixner wrote: >>> On Fri, 17 Feb 2017, kernel test robot wrote: >>> Hi Marc, We find this oops in linux-4.4.y. The gcc-6 compiled mainline kernel is fine. >> >> The last bit is worrying, as mainline has the exact same bug. Has it >> been tested the same way? > > The thing is that we reverted that patch in mainline: > > See: commit 82e88ff1ea948d83125a8aaa7c9809f03ccc500f Ah, right. It got nuked as part of the whole MONOTONIC_RAW blunder. > I don't know why I reverted that as well. I should have kept it. Darn. I > cherry pick it and send it linus wards next week. Yes, I still think this single patch is a valuable sanity check. Thanks, M. -- Jazz is not dead. It just smells funny...
Re: [linux-stable] 4fc2942b6e kernel BUG at kernel/time/hrtimer.c:109!
On Fri, 17 Feb 2017, Marc Zyngier wrote: > On 17/02/17 09:28, Thomas Gleixner wrote: > > On Fri, 17 Feb 2017, kernel test robot wrote: > > > >> Hi Marc, > >> > >> We find this oops in linux-4.4.y. The gcc-6 compiled mainline kernel is > >> fine. > > The last bit is worrying, as mainline has the exact same bug. Has it > been tested the same way? The thing is that we reverted that patch in mainline: See: commit 82e88ff1ea948d83125a8aaa7c9809f03ccc500f I don't know why I reverted that as well. I should have kept it. Darn. I cherry pick it and send it linus wards next week. Thanks, tglx
Re: [linux-stable] 4fc2942b6e kernel BUG at kernel/time/hrtimer.c:109!
On 17/02/17 09:28, Thomas Gleixner wrote: > On Fri, 17 Feb 2017, kernel test robot wrote: > >> Hi Marc, >> >> We find this oops in linux-4.4.y. The gcc-6 compiled mainline kernel is fine. The last bit is worrying, as mainline has the exact same bug. Has it been tested the same way? >> >> commit 4fc2942b6e2de2efc8a9d3784d4b0d3543149613 >> hrtimer: Catch illegal clockids > > And that commit is doing what the subject line says. Catch illegal usage. > >> [ 38.101342] Call Trace: >> [ 38.101342] Call Trace: >> [ 38.102045] [] tasklet_hrtimer_init+0x16/0x52 >> [ 38.102045] [] tasklet_hrtimer_init+0x16/0x52 >> [ 38.103698] [] mac80211_hwsim_new_radio+0x766/0x84d > > The real bug is in this code: > > drivers/net/wireless/mac80211_hwsim.c > > mac80211_hwsim_new_radio() > > tasklet_hrtimer_init(>beacon_timer, > mac80211_hwsim_beacon, > CLOCK_MONOTONIC_RAW, HRTIMER_MODE_ABS); > > CLOCK_MONOTONIC_RAW is not a supported clockid for hrtimers. Sigh. > > Fix below. > > Thanks, > > tglx > > 8<-- > > diff --git a/drivers/net/wireless/mac80211_hwsim.c > b/drivers/net/wireless/mac80211_hwsim.c > index 0cd95120bc78..da363ec91a1c 100644 > --- a/drivers/net/wireless/mac80211_hwsim.c > +++ b/drivers/net/wireless/mac80211_hwsim.c > @@ -2535,9 +2535,8 @@ static int mac80211_hwsim_new_radio(struct genl_info > *info, > data->debugfs, > data, _simulate_radar); > > - tasklet_hrtimer_init(>beacon_timer, > - mac80211_hwsim_beacon, > - CLOCK_MONOTONIC_RAW, HRTIMER_MODE_ABS); > + tasklet_hrtimer_init(>beacon_timer, mac80211_hwsim_beacon, > + CLOCK_MONOTONIC, HRTIMER_MODE_ABS); > > spin_lock_bh(_radio_lock); > list_add_tail(>list, _radios); > Acked-by: Marc ZyngierM. -- Jazz is not dead. It just smells funny...
Re: [linux-stable] 4fc2942b6e kernel BUG at kernel/time/hrtimer.c:109!
On Fri, 17 Feb 2017, kernel test robot wrote: > Hi Marc, > > We find this oops in linux-4.4.y. The gcc-6 compiled mainline kernel is fine. > > commit 4fc2942b6e2de2efc8a9d3784d4b0d3543149613 > hrtimer: Catch illegal clockids And that commit is doing what the subject line says. Catch illegal usage. > [ 38.101342] Call Trace: > [ 38.101342] Call Trace: > [ 38.102045] [] tasklet_hrtimer_init+0x16/0x52 > [ 38.102045] [] tasklet_hrtimer_init+0x16/0x52 > [ 38.103698] [] mac80211_hwsim_new_radio+0x766/0x84d The real bug is in this code: drivers/net/wireless/mac80211_hwsim.c mac80211_hwsim_new_radio() tasklet_hrtimer_init(>beacon_timer, mac80211_hwsim_beacon, CLOCK_MONOTONIC_RAW, HRTIMER_MODE_ABS); CLOCK_MONOTONIC_RAW is not a supported clockid for hrtimers. Sigh. Fix below. Thanks, tglx 8<-- diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c index 0cd95120bc78..da363ec91a1c 100644 --- a/drivers/net/wireless/mac80211_hwsim.c +++ b/drivers/net/wireless/mac80211_hwsim.c @@ -2535,9 +2535,8 @@ static int mac80211_hwsim_new_radio(struct genl_info *info, data->debugfs, data, _simulate_radar); - tasklet_hrtimer_init(>beacon_timer, -mac80211_hwsim_beacon, -CLOCK_MONOTONIC_RAW, HRTIMER_MODE_ABS); + tasklet_hrtimer_init(>beacon_timer, mac80211_hwsim_beacon, +CLOCK_MONOTONIC, HRTIMER_MODE_ABS); spin_lock_bh(_radio_lock); list_add_tail(>list, _radios);
[linux-stable] 4fc2942b6e kernel BUG at kernel/time/hrtimer.c:109!
Hi Marc, We find this oops in linux-4.4.y. The gcc-6 compiled mainline kernel is fine. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.4.y commit 4fc2942b6e2de2efc8a9d3784d4b0d3543149613 Author: Marc ZyngierAuthorDate: Fri Jan 15 17:41:09 2016 + Commit: Greg Kroah-Hartman CommitDate: Thu Sep 15 08:27:44 2016 +0200 hrtimer: Catch illegal clockids [ Upstream commit 9006a01829a50cfd6bbd4980910ed46e895e93d7 ] It is way too easy to take any random clockid and feed it to the hrtimer subsystem. At best, it gets mapped to a monotonic base, but it would be better to just catch illegal values as early as possible. This patch does exactly that, mapping illegal clockids to an illegal base index, and panicing when we detect the illegal condition. Signed-off-by: Marc Zyngier Cc: Tomasz Nowicki Cc: Christoffer Dall Link: http://lkml.kernel.org/r/1452879670-16133-3-git-send-email-marc.zyng...@arm.com Signed-off-by: Thomas Gleixner Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman +-++++ | | 8a840b7f37 | 4fc2942b6e | e30ab9304d | +-++++ | boot_successes | 63 | 0 | 0 | | boot_failures | 0 | 22 | 19 | | kernel_BUG_at_kernel/time/hrtimer.c | 0 | 22 | 19 | | invalid_opcode:#[##]| 0 | 22 | 19 | | invalid_opcode:#[##]DEBUG_PAGEALLOC_DEBUG_PAGEALLOC | 0 | 22 | 19 | | RIP:hrtimer_init| 0 | 22 | 19 | | calltrace:init_mac80211_hwsim | 0 | 22 | 19 | | Kernel_panic-not_syncing:Fatal_exception| 0 | 22 | 19 | +-++++ [ 38.061932] ieee80211 phy0: hwaddr 02:00:00:00:00:00 registered [ 38.063663] [ cut here ] [ 38.063663] [ cut here ] [ 38.064964] kernel BUG at kernel/time/hrtimer.c:109! [ 38.064964] kernel BUG at kernel/time/hrtimer.c:109! [ 38.066793] invalid opcode: [#1] [ 38.066793] invalid opcode: [#1] DEBUG_PAGEALLOC DEBUG_PAGEALLOC [ 38.068273] CPU: 0 PID: 1 Comm: swapper Not tainted 4.4.20-00072-g4fc2942 #10 [ 38.068273] CPU: 0 PID: 1 Comm: swapper Not tainted 4.4.20-00072-g4fc2942 #10 [ 38.070239] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.9.3-20161025_171302-gandalf 04/01/2014 [ 38.070239] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.9.3-20161025_171302-gandalf 04/01/2014 [ 38.073047] task: 8805c000 ti: 8806 task.ti: 8806 [ 38.073047] task: 8805c000 ti: 8806 task.ti: 8806 [ 38.075115] RIP: 0010:[] [ 38.075115] RIP: 0010:[] [] hrtimer_init+0x2a/0x41 [] hrtimer_init+0x2a/0x41 [ 38.077344] RSP: 0018:88063d98 EFLAGS: 00010246 [ 38.077344] RSP: 0018:88063d98 EFLAGS: 00010246 [ 38.078821] RAX: 0004 RBX: 88001d2a7498 RCX: [ 38.078821] RAX: 0004 RBX: 88001d2a7498 RCX: [ 38.080782] RDX: RSI: 0004 RDI: 88001d2a74d8 [ 38.080782] RDX: RSI: 0004 RDI: 88001d2a74d8 [ 38.082755] RBP: 88063d98 R08: 88001d2a7498 R09: [ 38.082755] RBP: 88063d98 R08: 88001d2a7498 R09: [ 38.084714] R10: 88001d295e68 R11: 83e1dc08 R12: 81c740e1 [ 38.084714] R10: 88001d295e68 R11: 83e1dc08 R12: 81c740e1 [ 38.086674] R13: 88063e38 R14: R15: [ 38.086674] R13: 88063e38 R14: R15: [ 38.088647] FS: () GS:82c21000() knlGS: [ 38.088647] FS: () GS:82c21000() knlGS: [ 38.090864] CS: 0010 DS: ES: CR0: 80050033 [ 38.090864] CS: 0010 DS: ES: CR0: 80050033 [ 38.092438] CR2: 7fa2354bb8ec CR3: 1d8ba000 CR4: 001406f0 [ 38.092438] CR2: 7fa2354bb8ec CR3: 1d8ba000 CR4: 001406f0 [