linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Begunkov <asml.silence@gmail.com>
To: Hillf Danton <hdanton@sina.com>,
	syzbot <syzbot+9ec0395bc17f2b1e3cc1@syzkaller.appspotmail.com>
Cc: axboe@kernel.dk, io-uring@vger.kernel.org,
	linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Re: general protection fault in io_sqe_files_unregister
Date: Sat, 9 Jan 2021 16:12:05 +0000	[thread overview]
Message-ID: <0156ca8e-0914-3fff-1f2f-a48f14cf46b1@gmail.com> (raw)
In-Reply-To: <20210109115030.11184-1-hdanton@sina.com>

On 09/01/2021 11:50, Hillf Danton wrote:
> Sat, 09 Jan 2021 00:29:16 -0800
>> syzbot found the following issue on:
>>
>> HEAD commit:    71c061d2 Merge tag 'for-5.11-rc2-tag' of git://git.kernel...
>> git tree:       upstream
>> console output: https://syzkaller.appspot.com/x/log.txt?x=17ec3f67500000
>> kernel config:  https://syzkaller.appspot.com/x/.config?x=8aa30b9da402d224
>> dashboard link: https://syzkaller.appspot.com/bug?extid=9ec0395bc17f2b1e3cc1
>> compiler:       gcc (GCC) 10.1.0-syz 20200507
>>
>> Unfortunately, I don't have any reproducer for this issue yet.
>>
>> IMPORTANT: if you fix the issue, please add the following tag to the commit:
>> Reported-by: syzbot+9ec0395bc17f2b1e3cc1@syzkaller.appspotmail.com
>>
>> general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] PREEMPT SMP KASAN
>> KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007]
>> CPU: 1 PID: 9107 Comm: syz-executor.2 Not tainted 5.11.0-rc2-syzkaller #0
>> Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
>> RIP: 0010:__list_add include/linux/list.h:71 [inline]
>> RIP: 0010:list_add_tail include/linux/list.h:100 [inline]
>> RIP: 0010:io_sqe_files_set_node fs/io_uring.c:7243 [inline]
>> RIP: 0010:io_sqe_files_unregister+0x42a/0x770 fs/io_uring.c:7279
>> Code: 00 fc ff df 48 c1 ea 03 80 3c 02 00 0f 85 07 03 00 00 4c 89 ea 4c 89 ad 88 00 00 00 48 b8 00 00 00 00 00 fc ff df 48 c1 ea 03 <80> 3c 02 00 0f 85 f4 02 00 00 49 8d 7f 18 48 8d 85 80 00 00 00 48
>> RSP: 0018:ffffc9000982fcf8 EFLAGS: 00010247
>> RAX: dffffc0000000000 RBX: ffff88814763fe90 RCX: ffffc9000d28d000
>> RDX: 0000000000000000 RSI: ffffffff81d82695 RDI: 0000000000000003
>> RBP: ffff88814763fe00 R08: 0000000000000001 R09: 0000000000000001
>> R10: ffffffff81d82684 R11: 0000000000000000 R12: 00000000fffffffc
>> R13: 0000000000000004 R14: ffff88814763fe80 R15: fffffffffffffff4
>> FS:  00007f6532203700(0000) GS:ffff8880b9f00000(0000) knlGS:0000000000000000
>> CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
>> CR2: 00000000200000d8 CR3: 0000000014ad5000 CR4: 00000000001506e0
>> DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
>> DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
>> Call Trace:
>>  __io_uring_register fs/io_uring.c:9916 [inline]
>>  __do_sys_io_uring_register+0x1185/0x4080 fs/io_uring.c:10000
>>  do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
>>  entry_SYSCALL_64_after_hwframe+0x44/0xa9
>> RIP: 0033:0x45e219
>> Code: 0d b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 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 0f 83 db b3 fb ff c3 66 2e 0f 1f 84 00 00 00 00
>> RSP: 002b:00007f6532202c68 EFLAGS: 00000246 ORIG_RAX: 00000000000001ab
>> RAX: ffffffffffffffda RBX: 0000000000000007 RCX: 000000000045e219
>> RDX: 0000000000000000 RSI: 0000000000000003 RDI: 0000000000000003
>> RBP: 00007f6532202ca0 R08: 0000000000000000 R09: 0000000000000000
>> R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
>> R13: 00000000016afb5f R14: 00007f65322039c0 R15: 000000000119bf8c
>> Modules linked in:
>> ---[ end trace 6e4aada9e44ca3d1 ]---
> 
> Fix typo in 1ffc54220c44

Thanks for the suggestion, but it was already fixed

#syz fix: io_uring: Fix return value from alloc_fixed_file_ref_node

> 
> --- a/fs/io_uring.c
> +++ b/fs/io_uring.c
> @@ -7255,8 +7255,8 @@ static int io_sqe_files_unregister(struc
>  	if (!data)
>  		return -ENXIO;
>  	backup_node = alloc_fixed_file_ref_node(ctx);
> -	if (!backup_node)
> -		return -ENOMEM;
> +	if (IS_ERR(backup_node))
> +		return PTR_ERR(backup_node);
>  
>  	spin_lock_bh(&data->lock);
>  	ref_node = data->node;
> 

-- 
Pavel Begunkov

      parent reply	other threads:[~2021-01-09 16:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-09  8:29 general protection fault in io_sqe_files_unregister syzbot
     [not found] ` <20210109115030.11184-1-hdanton@sina.com>
2021-01-09 16:12   ` Pavel Begunkov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0156ca8e-0914-3fff-1f2f-a48f14cf46b1@gmail.com \
    --to=asml.silence@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=hdanton@sina.com \
    --cc=io-uring@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzbot+9ec0395bc17f2b1e3cc1@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).