[syzbot] general protection fault in set_task_ioprio

11 views
Skip to first unread message

syzbot

unread,
Dec 20, 2021, 10:04:18ā€ÆPM12/20/21
to ax...@kernel.dk, linux...@vger.kernel.org, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 07f8c60fe60f Add linux-next specific files for 20211220
git tree: linux-next
console output: https://syzkaller.appspot.com/x/log.txt?x=1355d295b00000
kernel config: https://syzkaller.appspot.com/x/.config?x=2060504830b9124a
dashboard link: https://syzkaller.appspot.com/bug?extid=8836466a79f4175961b0
compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=12058fcbb00000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=17141adbb00000

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+883646...@syzkaller.appspotmail.com

general protection fault, probably for non-canonical address 0xdffffc0000000001: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000008-0x000000000000000f]
CPU: 1 PID: 3602 Comm: syz-executor484 Not tainted 5.16.0-rc5-next-20211220-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:set_task_ioprio+0x2de/0x620 block/blk-ioc.c:289 block/blk-ioc.c:289
Code: 4c 8b ab 18 12 00 00 4d 85 ed 0f 84 9b 01 00 00 e8 d7 1e a4 fd 49 8d 7d 0c 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <0f> b6 14 02 48 89 f8 83 e0 07 83 c0 01 38 d0 7c 08 84 d2 0f 85 ef
RSP: 0018:ffffc90001b1fe90 EFLAGS: 00010203
RAX: dffffc0000000000 RBX: ffff88801f888000 RCX: 0000000000000000
RDX: 0000000000000001 RSI: ffffffff83d3f779 RDI: 000000000000000c
RBP: 0000000000000000 R08: 0000000000000000 R09: ffffffff8ffaf957
R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000000
R13: 0000000000000000 R14: ffff88801f888948 R15: ffff88801f889218
FS: 0000555556a34300(0000) GS:ffff8880b9d00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f2155cab01d CR3: 00000000149ed000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
__do_sys_ioprio_set+0x586/0xae0 block/ioprio.c:124 block/ioprio.c:124
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_x64 arch/x86/entry/common.c:50 [inline] arch/x86/entry/common.c:80
do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7f2155c67cf9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 b1 14 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffc6f0f50c8 EFLAGS: 00000246 ORIG_RAX: 00000000000000fb
RAX: ffffffffffffffda RBX: 000000000000cbcf RCX: 00007f2155c67cf9
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000003
RBP: 0000000000000000 R08: 00007ffc6f0f5268 R09: 00007ffc6f0f5268
R10: ffffffffffffffff R11: 0000000000000246 R12: 00007ffc6f0f50dc
R13: 431bde82d7b634db R14: 0000000000000000 R15: 0000000000000000
</TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:set_task_ioprio+0x2de/0x620 block/blk-ioc.c:289 block/blk-ioc.c:289
Code: 4c 8b ab 18 12 00 00 4d 85 ed 0f 84 9b 01 00 00 e8 d7 1e a4 fd 49 8d 7d 0c 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <0f> b6 14 02 48 89 f8 83 e0 07 83 c0 01 38 d0 7c 08 84 d2 0f 85 ef
RSP: 0018:ffffc90001b1fe90 EFLAGS: 00010203
RAX: dffffc0000000000 RBX: ffff88801f888000 RCX: 0000000000000000
RDX: 0000000000000001 RSI: ffffffff83d3f779 RDI: 000000000000000c
RBP: 0000000000000000 R08: 0000000000000000 R09: ffffffff8ffaf957
R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000000
R13: 0000000000000000 R14: ffff88801f888948 R15: ffff88801f889218
FS: 0000555556a34300(0000) GS:ffff8880b9d00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f2155cab01d CR3: 00000000149ed000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
0: 4c 8b ab 18 12 00 00 mov 0x1218(%rbx),%r13
7: 4d 85 ed test %r13,%r13
a: 0f 84 9b 01 00 00 je 0x1ab
10: e8 d7 1e a4 fd callq 0xfda41eec
15: 49 8d 7d 0c lea 0xc(%r13),%rdi
19: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax
20: fc ff df
23: 48 89 fa mov %rdi,%rdx
26: 48 c1 ea 03 shr $0x3,%rdx
* 2a: 0f b6 14 02 movzbl (%rdx,%rax,1),%edx <-- trapping instruction
2e: 48 89 f8 mov %rdi,%rax
31: 83 e0 07 and $0x7,%eax
34: 83 c0 01 add $0x1,%eax
37: 38 d0 cmp %dl,%al
39: 7c 08 jl 0x43
3b: 84 d2 test %dl,%dl
3d: 0f .byte 0xf
3e: 85 ef test %ebp,%edi
----------------
Code disassembly (best guess):
0: 4c 8b ab 18 12 00 00 mov 0x1218(%rbx),%r13
7: 4d 85 ed test %r13,%r13
a: 0f 84 9b 01 00 00 je 0x1ab
10: e8 d7 1e a4 fd callq 0xfda41eec
15: 49 8d 7d 0c lea 0xc(%r13),%rdi
19: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax
20: fc ff df
23: 48 89 fa mov %rdi,%rdx
26: 48 c1 ea 03 shr $0x3,%rdx
* 2a: 0f b6 14 02 movzbl (%rdx,%rax,1),%edx <-- trapping instruction
2e: 48 89 f8 mov %rdi,%rax
31: 83 e0 07 and $0x7,%eax
34: 83 c0 01 add $0x1,%eax
37: 38 d0 cmp %dl,%al
39: 7c 08 jl 0x43
3b: 84 d2 test %dl,%dl
3d: 0f .byte 0xf
3e: 85 ef test %ebp,%edi


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
syzbot can test patches for this issue, for details see:
https://goo.gl/tpsmEJ#testing-patches

Jens Axboe

unread,
Dec 20, 2021, 10:34:43ā€ÆPM12/20/21
to syzbot, linux...@vger.kernel.org, linux-...@vger.kernel.org, syzkall...@googlegroups.com
On 12/20/21 8:04 PM, syzbot wrote:
> Hello,
>
> syzbot found the following issue on:
>
> HEAD commit: 07f8c60fe60f Add linux-next specific files for 20211220
> git tree: linux-next
> console output: https://syzkaller.appspot.com/x/log.txt?x=1355d295b00000
> kernel config: https://syzkaller.appspot.com/x/.config?x=2060504830b9124a
> dashboard link: https://syzkaller.appspot.com/bug?extid=8836466a79f4175961b0
> compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2
> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=12058fcbb00000
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=17141adbb00000
>
> IMPORTANT: if you fix the issue, please add the following tag to the commit:
> Reported-by: syzbot+883646...@syzkaller.appspotmail.com

#syz test git://git.kernel.dk/linux-block for-next

--
Jens Axboe

syzbot

unread,
Dec 21, 2021, 12:21:08ā€ÆAM12/21/21
to ax...@kernel.dk, linux...@vger.kernel.org, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-and-tested-by: syzbot+883646...@syzkaller.appspotmail.com

Tested on:

commit: e1ad6d38 Merge branch 'for-5.17/block' into for-next
git tree: git://git.kernel.dk/linux-block for-next
kernel config: https://syzkaller.appspot.com/x/.config?x=f22078a087d573ce
dashboard link: https://syzkaller.appspot.com/bug?extid=8836466a79f4175961b0
compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2

Note: testing is done by a robot and is best-effort only.

syzbot

unread,
Dec 21, 2021, 4:52:09ā€ÆAM12/21/21
to ax...@kernel.dk, chang...@intel.com, christia...@ubuntu.com, dan...@iogearbox.net, da...@davemloft.net, edum...@google.com, hkall...@gmail.com, ku...@kernel.org, linux...@vger.kernel.org, linux-...@vger.kernel.org, net...@vger.kernel.org, syzkall...@googlegroups.com, yajun...@linux.dev
syzbot has bisected this issue to:

commit e4b8954074f6d0db01c8c97d338a67f9389c042f
Author: Eric Dumazet <edum...@google.com>
Date: Tue Dec 7 01:30:37 2021 +0000

netlink: add net device refcount tracker to struct ethnl_req_info

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=10620fcdb00000
start commit: 07f8c60fe60f Add linux-next specific files for 20211220
git tree: linux-next
final oops: https://syzkaller.appspot.com/x/report.txt?x=12620fcdb00000
console output: https://syzkaller.appspot.com/x/log.txt?x=14620fcdb00000
Reported-by: syzbot+883646...@syzkaller.appspotmail.com
Fixes: e4b8954074f6 ("netlink: add net device refcount tracker to struct ethnl_req_info")

For information about bisection process see: https://goo.gl/tpsmEJ#bisection

Eric Dumazet

unread,
Dec 21, 2021, 5:44:49ā€ÆAM12/21/21
to syzbot, Christoph Hellwig, Jens Axboe, chang...@intel.com, Christian Brauner, Daniel Borkmann, David Miller, Heiner Kallweit, Jakub Kicinski, linux...@vger.kernel.org, LKML, netdev, syzkaller-bugs, Yajun Deng
On Tue, Dec 21, 2021 at 1:52 AM syzbot
<syzbot+883646...@syzkaller.appspotmail.com> wrote:
>
> syzbot has bisected this issue to:
>
> commit e4b8954074f6d0db01c8c97d338a67f9389c042f
> Author: Eric Dumazet <edum...@google.com>
> Date: Tue Dec 7 01:30:37 2021 +0000
>
> netlink: add net device refcount tracker to struct ethnl_req_info
>

Unfortunately this commit will be in the way of many bisections.

Real bug was added in

commit 5fc11eebb4a98df5324a4de369bb5ab7f0007ff7
Author: Christoph Hellwig <h...@lst.de>
Date: Thu Dec 9 07:31:29 2021 +0100

block: open code create_task_io_context in set_task_ioprio

The flow in set_task_ioprio can be simplified by simply open coding
create_task_io_context, which removes a refcount roundtrip on the I/O
context.

Signed-off-by: Christoph Hellwig <h...@lst.de>
Reviewed-by: Jan Kara <ja...@suse.cz>
Link: https://lore.kernel.org/r/2021120906313...@lst.de
Signed-off-by: Jens Axboe <ax...@kernel.dk>

Jens Axboe

unread,
Dec 21, 2021, 10:25:07ā€ÆAM12/21/21
to Eric Dumazet, syzbot, Christoph Hellwig, chang...@intel.com, Christian Brauner, Daniel Borkmann, David Miller, Heiner Kallweit, Jakub Kicinski, linux...@vger.kernel.org, LKML, netdev, syzkaller-bugs, Yajun Deng
On 12/21/21 3:44 AM, Eric Dumazet wrote:
> On Tue, Dec 21, 2021 at 1:52 AM syzbot
> <syzbot+883646...@syzkaller.appspotmail.com> wrote:
>>
>> syzbot has bisected this issue to:
>>
>> commit e4b8954074f6d0db01c8c97d338a67f9389c042f
>> Author: Eric Dumazet <edum...@google.com>
>> Date: Tue Dec 7 01:30:37 2021 +0000
>>
>> netlink: add net device refcount tracker to struct ethnl_req_info
>>
>
> Unfortunately this commit will be in the way of many bisections.
>
> Real bug was added in
>
> commit 5fc11eebb4a98df5324a4de369bb5ab7f0007ff7
> Author: Christoph Hellwig <h...@lst.de>
> Date: Thu Dec 9 07:31:29 2021 +0100
>
> block: open code create_task_io_context in set_task_ioprio
>
> The flow in set_task_ioprio can be simplified by simply open coding
> create_task_io_context, which removes a refcount roundtrip on the I/O
> context.
>
> Signed-off-by: Christoph Hellwig <h...@lst.de>
> Reviewed-by: Jan Kara <ja...@suse.cz>
> Link: https://lore.kernel.org/r/2021120906313...@lst.de
> Signed-off-by: Jens Axboe <ax...@kernel.dk>

There are only really 5 patches in between the broken commit and the one
that fixes it, and it only affects things trying to set the ioprio with
a dead task. Is this a huge issue? I don't see why this would cause a
lot of bisection headaches.

--
Jens Axboe

Eric Dumazet

unread,
Dec 21, 2021, 11:04:08ā€ÆAM12/21/21
to Jens Axboe, syzbot, Christoph Hellwig, chang...@intel.com, Christian Brauner, Daniel Borkmann, David Miller, Heiner Kallweit, Jakub Kicinski, linux...@vger.kernel.org, LKML, netdev, syzkaller-bugs, Yajun Deng
I was saying that my commit was polluting syzbot bisection, this is a
distraction in this report.
(Or if you prefer, please ignore syzbot bisection)

linux-next has still this bug in set_task_ioprio()


> --
> Jens Axboe
>

Jens Axboe

unread,
Dec 21, 2021, 11:30:10ā€ÆAM12/21/21
to Eric Dumazet, syzbot, Christoph Hellwig, chang...@intel.com, Christian Brauner, Daniel Borkmann, David Miller, Heiner Kallweit, Jakub Kicinski, linux...@vger.kernel.org, LKML, netdev, syzkaller-bugs, Yajun Deng
Ah got it, yes makes sense.

> linux-next has still this bug in set_task_ioprio()

linux-next often trails by a few days, once it catches up hopefully
this will be behind us.

--
Jens Axboe

Reply all
Reply to author
Forward
0 new messages