Re: BUG: unable to handle kernel paging request in percpu_ref_exit

2021-01-09 Thread Pavel Begunkov
On 09/01/2021 17:01, syzbot wrote:
> Hello,
> 
> syzbot has tested the proposed patch and the reproducer did not trigger any 
> issue:

#syz fix: io_uring: Fix return value from alloc_fixed_file_ref_node

> 
> Reported-and-tested-by: syzbot+99ed55100402022a6...@syzkaller.appspotmail.com
> 
> Tested on:
> 
> commit: d9d05217 io_uring: stop SQPOLL submit on creator's death
> git tree:   git://git.kernel.dk/linux-block
> kernel config:  https://syzkaller.appspot.com/x/.config?x=2455d075a1c4afa8
> dashboard link: https://syzkaller.appspot.com/bug?extid=99ed55100402022a6276
> compiler:   gcc (GCC) 10.1.0-syz 20200507
> 
> Note: testing is done by a robot and is best-effort only.
> 

-- 
Pavel Begunkov


Re: BUG: unable to handle kernel paging request in percpu_ref_exit

2021-01-09 Thread syzbot
Hello,

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

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

Tested on:

commit: d9d05217 io_uring: stop SQPOLL submit on creator's death
git tree:   git://git.kernel.dk/linux-block
kernel config:  https://syzkaller.appspot.com/x/.config?x=2455d075a1c4afa8
dashboard link: https://syzkaller.appspot.com/bug?extid=99ed55100402022a6276
compiler:   gcc (GCC) 10.1.0-syz 20200507

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


Re: BUG: unable to handle kernel paging request in percpu_ref_exit

2021-01-09 Thread Pavel Begunkov
On 09/01/2021 16:27, syzbot wrote:
> Hello,
> 
> syzbot found the following issue on:
> 
> HEAD commit:36bbbd0e Merge branch 'rcu/urgent' of git://git.kernel.org..
> git tree:   upstream
> console output: https://syzkaller.appspot.com/x/log.txt?x=149afeeb50
> kernel config:  https://syzkaller.appspot.com/x/.config?x=8aa30b9da402d224
> dashboard link: https://syzkaller.appspot.com/bug?extid=99ed55100402022a6276
> compiler:   gcc (GCC) 10.1.0-syz 20200507
> syz repro:  https://syzkaller.appspot.com/x/repro.syz?x=10496f70d0
> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=10cedf70d0
> 
> IMPORTANT: if you fix the issue, please add the following tag to the commit:
> Reported-by: syzbot+99ed55100402022a6...@syzkaller.appspotmail.com
> Fixes: 4d004099a668 ("lockdep: Fix lockdep recursion")

Looks like the fixed ERR_PTR vs NULL issue.

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

> 
> RBP: 0005 R08: 0001 R09: 00401140
> R10:  R11: 0246 R12: 00402860
> R13: 004028f0 R14:  R15: 
> BUG: unable to handle page fault for address: fffc
> #PF: supervisor read access in kernel mode
> #PF: error_code(0x) - not-present page
> PGD b08f067 P4D b08f067 PUD b091067 PMD 0 
> Oops:  [#1] PREEMPT SMP KASAN
> CPU: 0 PID: 8500 Comm: syz-executor191 Not tainted 5.11.0-rc2-syzkaller #0
> Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS 
> Google 01/01/2011
> RIP: 0010:percpu_ref_exit+0x2f/0x140 lib/percpu-refcount.c:130
> Code: 54 55 53 48 89 fb e8 f0 fc b6 fd 48 8d 6b 08 48 b8 00 00 00 00 00 fc ff 
> df 48 89 ea 48 c1 ea 03 80 3c 02 00 0f 85 d5 00 00 00 <4c> 8b 73 08 48 89 df 
> e8 c5 fe ff ff 4d 85 f6 0f 84 b3 00 00 00 e8
> RSP: 0018:c9000126fcc8 EFLAGS: 00010246
> RAX: dc00 RBX: fff4 RCX: 
> RDX: 1fff RSI: 83bb78b0 RDI: fff4
> RBP: fffc R08: 0001 R09: 8ebda867
> R10: fbfff1d7b50c R11:  R12: 
> R13: 88801adee000 R14: 0002 R15: fff4
> FS:  0179f940() GS:8880b9e0() knlGS:
> CS:  0010 DS:  ES:  CR0: 80050033
> CR2: fffc CR3: 2027 CR4: 001506f0
> DR0:  DR1:  DR2: 
> DR3:  DR6: fffe0ff0 DR7: 0400
> Call Trace:
>  destroy_fixed_file_ref_node fs/io_uring.c:7703 [inline]
>  io_sqe_files_unregister+0x30b/0x770 fs/io_uring.c:7293
>  __io_uring_register fs/io_uring.c:9916 [inline]
>  __do_sys_io_uring_register+0x1185/0x4080 fs/io_uring.c:1
>  do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
>  entry_SYSCALL_64_after_hwframe+0x44/0xa9
> RIP: 0033:0x444df9
> Code: 18 89 d0 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 00 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 0f 
> 83 db d5 fb ff c3 66 2e 0f 1f 84 00 00 00 00
> RSP: 002b:7ffeb192ade8 EFLAGS: 0246 ORIG_RAX: 01ab
> RAX: ffda RBX: 7ffeb192ae90 RCX: 00444df9
> RDX:  RSI: 0003 RDI: 0004
> RBP: 0005 R08: 0001 R09: 00401140
> R10:  R11: 0246 R12: 00402860
> R13: 004028f0 R14:  R15: 
> Modules linked in:
> CR2: fffc
> ---[ end trace ed34d5d65a155c02 ]---
> RIP: 0010:percpu_ref_exit+0x2f/0x140 lib/percpu-refcount.c:130
> Code: 54 55 53 48 89 fb e8 f0 fc b6 fd 48 8d 6b 08 48 b8 00 00 00 00 00 fc ff 
> df 48 89 ea 48 c1 ea 03 80 3c 02 00 0f 85 d5 00 00 00 <4c> 8b 73 08 48 89 df 
> e8 c5 fe ff ff 4d 85 f6 0f 84 b3 00 00 00 e8
> RSP: 0018:c9000126fcc8 EFLAGS: 00010246
> RAX: dc00 RBX: fff4 RCX: 
> RDX: 1fff RSI: 83bb78b0 RDI: fff4
> RBP: fffc R08: 0001 R09: 8ebda867
> R10: fbfff1d7b50c R11:  R12: 
> R13: 88801adee000 R14: 0002 R15: fff4
> FS:  0179f940() GS:8880b9e0() knlGS:
> CS:  0010 DS:  ES:  CR0: 80050033
> CR2: fffc CR3: 2027 CR4: 001506f0
> DR0:  DR1:  DR2: 
> DR3:  DR6: fffe0ff0 DR7: 0400
> 
> 
> ---
> 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 syzkal...@googlegroups.com.
> 
> syzbot will keep track of this issue. See:
> https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
> For information about bisection process see