Skip to contentSkip to conversation

WARNING: CPU: 12 PID: 16862 at ./arch/x86/include/asm/thread_info.h:236

DISCUSSION Sasha Levin 4 participants 5 messages Nov 30, 2015 – Jan 9, 2016

lore
Share & tools
lore
#0 lore raw

Hi all,

I've hit the following while fuzzing with trinity on the latest -next kernel:

[  587.536319] WARNING: CPU: 12 PID: 16862 at ./arch/x86/include/asm/thread_info.h:236 sigsuspend+0x194/0x1b0()
[  587.540863] Modules linked in:
[  587.541742] CPU: 12 PID: 16862 Comm: trinity-c421 Not tainted 4.4.0-rc2-next-20151127-sasha-00011-g1ca161c-dirty #2660
[  587.543554]  0000000000000000 000000002c914859 ffff8806e3347e38 ffffffff9ea923db
[  587.545672]  0000000000000000 ffff8800c8032000 ffffffffa64a5120 ffff8806e3347e78
[  587.547042]  ffffffff9d2e00d9 ffffffff9d307334 ffffffffa64a5120 00000000000000ec
[  587.549585] Call Trace:
[  587.550261]  [<ffffffff9ea923db>] dump_stack+0x72/0xb7
[  587.551125]  [<ffffffff9d2e00d9>] warn_slowpath_common+0x109/0x130
[  587.553088]  [<ffffffff9d2e0329>] warn_slowpath_null+0x29/0x30
[  587.554164]  [<ffffffff9d307334>] sigsuspend+0x194/0x1b0
[  587.555116]  [<ffffffff9d30b47b>] SyS_rt_sigsuspend+0xbb/0x110
[  587.561511]  [<ffffffffa61fbbd5>] entry_SYSCALL_64_fastpath+0x35/0x99
[  587.563289] ---[ end trace 76d0b7c8c18c2a7d ]---

Thanks,
Sasha

#1 lore raw
Quoted 3 lines · Sasha Levin

Hi all,

I've hit the following while fuzzing with trinity on the latest -next kernel:

        __set_current_state(TASK_INTERRUPTIBLE);
        schedule();
        set_restore_sigmask();

somehow got out of schedule() without TIF_SIGPENDING being set...

#2 lore raw
Quoted 10 lines · Al Viro
Quoted 3 lines · Sasha Levin

Hi all,

I've hit the following while fuzzing with trinity on the latest -next kernel:

        __set_current_state(TASK_INTERRUPTIBLE);
        schedule();
        set_restore_sigmask();

somehow got out of schedule() without TIF_SIGPENDING being set...

A random wakeup (which are always possible) can make that happen, right?

I'm (as always) a little vague on signals, but who is responsible for setting that bit?

#3 lore raw
Quoted 7 lines · Peter Zijlstra
Quoted 5 lines · Al Viro
Quoted 3 lines · Sasha Levin

Hi all,

I've hit the following while fuzzing with trinity on the latest -next kernel:

Quoted 7 lines
Quoted 5 lines
        __set_current_state(TASK_INTERRUPTIBLE);
        schedule();
        set_restore_sigmask();

somehow got out of schedule() without TIF_SIGPENDING being set...

A random wakeup (which are always possible) can make that happen, right?

Yes, sigsuspend() should do "while (!signal_pending(current))". Like sys_pause() does, -ERESTARTNOHAND without signal_pending() is equally wrong.

I'll send the fix unless Sasha wants to do this.

Quoted 2 lines

I'm (as always) a little vague on signals, but who is responsible for setting that bit?

See above, TS_RESTORE_SIGMASK doesn't differ from -ERESTART* in that you can only use it if signal_pending() is true.

Oleg.

#4 lore raw
Quoted 5 lines · Oleg Nesterov

Yes, sigsuspend() should do "while (!signal_pending(current))". Like sys_pause() does, -ERESTARTNOHAND without signal_pending() is equally wrong.

I'll send the fix unless Sasha wants to do this.

Looks like neither mainline nor -next has that...