Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp2178638ybg; Thu, 30 Jul 2020 12:22:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyu2+RZNgJsN2ggiN7nhuoFFCS0s3i7krZFzbt8lc7upPXPW3+MinS5ac5TX1WfnbX5PYKB X-Received: by 2002:a50:99cf:: with SMTP id n15mr496300edb.352.1596136945346; Thu, 30 Jul 2020 12:22:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596136945; cv=none; d=google.com; s=arc-20160816; b=K1dyW+1z/N4MpDiSHagGdtUgj8tv6ZT2MTNfABmL1lN0vk1hmQSXSV0wEquK6A8seJ Wkcoeo9/14afUW9p6wq2bGyduFnl7bTA7AtW191bX1meZ3ayhbaJ6J/VeCF8eqWDEOo5 i3dbriJdssAfP+x3y0Hk3wvQAfy4rrYh2zQx5ATTsGT3bRhRgWQRNv5xEYMlOphLUayf Ihrs35B4wkGp8Z48iXu/Jddwp3d39cCD5TGbbtM7Mn6JH8H2kegFvbMqpxDhcx8LLh8A +A77l7cY7yLUOH1LBjFOMMdbuIplk+KoxF4p+gYpJTqwMUun1tIvs5ZMWwCnK/DNBC8t xzjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:from:subject:message-id:date :mime-version; bh=zcGvcLBkmLVIiitWjC0dTjPKNOWpI78/MjOsV9KI+nI=; b=LGkBh0xF5cMX5WeaYeMDtSSbVmGli2wwh7OJlGH18GYTvFE5qDhvA50HuHIcakz4AK UvY5zUglGIjO7tEqM/Uts630xZIih0HjWTeJiWuA6AUhcKcJPlaqpfYNXEhe4xg9qnbo /tFVnu97Umc7bOdhdnDNQ8sLJ2HRXCGg35Qi7dnP3OPJRh/zn8TF/gdyJb75Iu1gzYjh 4A4q7HXM26QvsM1pjKcAlVeatmx/KfqaB/mXSEv1b13ki39QEbZi50HqNpwzdmusZOvG +XVErjcYVbBuLCNIh/bpRg7nSLNunIGQEkkTvG0NZiTj12FBi/yg6s5mP35X43taCGvq 7+WA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=appspotmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z7si4908772ede.370.2020.07.30.12.22.02; Thu, 30 Jul 2020 12:22:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=appspotmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728644AbgG3TVV (ORCPT + 99 others); Thu, 30 Jul 2020 15:21:21 -0400 Received: from mail-io1-f69.google.com ([209.85.166.69]:55672 "EHLO mail-io1-f69.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726840AbgG3TVT (ORCPT ); Thu, 30 Jul 2020 15:21:19 -0400 Received: by mail-io1-f69.google.com with SMTP id k10so19196251ioh.22 for ; Thu, 30 Jul 2020 12:21:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:date:message-id:subject:from:to; bh=zcGvcLBkmLVIiitWjC0dTjPKNOWpI78/MjOsV9KI+nI=; b=A5QL2OApqFRFSqxGOzB5hLvecVP7is+wZI08mvtMq6SC9TPLIDGsseA+IOYB0iSuSw 5OUX2dHljMklEhtqV1rxeKKU7gDFY2wvua2BGfaZk9pm3JpwFr48fa8fez8An8ZrOW0T sQyJk1LD7DIjVxbqaQHimhCA7eNAgSulYPmawiYKJA0CESkuJK52CtTCV6RhxDtLyTnh +z01NjIhBIx7ue3pR3SDTS+b9WXM/TDAoHacDQfbFetFRkJC6vf4S6HUwKtb9jNJcJD9 VVCcVBJceN+TXhoOrhk56NLY6D59JwhrgQkGCWb4UpsxHHLJLK+HjLvEMUOaeb1B0Aqv cDTQ== X-Gm-Message-State: AOAM533Av5WG/Xl9ezH4IA5E/XPQUn/WaZMnC/NH7Vu9eyHZSzpZOE72 aiiaEC1JzuHUtcB0MhV9pTUU9Gg/mkAjC9ksHfcpcXRcx/Iu MIME-Version: 1.0 X-Received: by 2002:a05:6e02:c1:: with SMTP id r1mr119662ilq.34.1596136878205; Thu, 30 Jul 2020 12:21:18 -0700 (PDT) Date: Thu, 30 Jul 2020 12:21:18 -0700 X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <000000000000a3709905abad9335@google.com> Subject: KASAN: use-after-free Read in io_uring_setup (2) From: syzbot To: axboe@kernel.dk, io-uring@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com, viro@zeniv.linux.org.uk Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, syzbot found the following issue on: HEAD commit: 04b45717 Add linux-next specific files for 20200729 git tree: linux-next console output: https://syzkaller.appspot.com/x/log.txt?x=173774b8900000 kernel config: https://syzkaller.appspot.com/x/.config?x=ec68f65b459f1ed dashboard link: https://syzkaller.appspot.com/bug?extid=9d46305e76057f30c74e 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+9d46305e76057f30c74e@syzkaller.appspotmail.com ================================================================== BUG: KASAN: use-after-free in io_account_mem fs/io_uring.c:7397 [inline] BUG: KASAN: use-after-free in io_uring_create fs/io_uring.c:8369 [inline] BUG: KASAN: use-after-free in io_uring_setup+0x2797/0x2910 fs/io_uring.c:8400 Read of size 1 at addr ffff888087a41044 by task syz-executor.5/18145 CPU: 0 PID: 18145 Comm: syz-executor.5 Not tainted 5.8.0-rc7-next-20200729-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x18f/0x20d lib/dump_stack.c:118 print_address_description.constprop.0.cold+0xae/0x497 mm/kasan/report.c:383 __kasan_report mm/kasan/report.c:513 [inline] kasan_report.cold+0x1f/0x37 mm/kasan/report.c:530 io_account_mem fs/io_uring.c:7397 [inline] io_uring_create fs/io_uring.c:8369 [inline] io_uring_setup+0x2797/0x2910 fs/io_uring.c:8400 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x45c429 Code: 8d b6 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 5b b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f8f121d0c78 EFLAGS: 00000246 ORIG_RAX: 00000000000001a9 RAX: ffffffffffffffda RBX: 0000000000008540 RCX: 000000000045c429 RDX: 0000000000000000 RSI: 0000000020000040 RDI: 0000000000000196 RBP: 000000000078bf38 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000078bf0c R13: 00007fff86698cff R14: 00007f8f121d19c0 R15: 000000000078bf0c Allocated by task 18145: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48 kasan_set_track mm/kasan/common.c:56 [inline] __kasan_kmalloc.constprop.0+0xbf/0xd0 mm/kasan/common.c:461 kmem_cache_alloc_trace+0x16e/0x2c0 mm/slab.c:3550 kmalloc include/linux/slab.h:554 [inline] kzalloc include/linux/slab.h:666 [inline] io_ring_ctx_alloc fs/io_uring.c:1042 [inline] io_uring_create fs/io_uring.c:8313 [inline] io_uring_setup+0x4df/0x2910 fs/io_uring.c:8400 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Freed by task 15583: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48 kasan_set_track+0x1c/0x30 mm/kasan/common.c:56 kasan_set_free_info+0x1b/0x30 mm/kasan/generic.c:355 __kasan_slab_free+0xd8/0x120 mm/kasan/common.c:422 __cache_free mm/slab.c:3418 [inline] kfree+0x103/0x2c0 mm/slab.c:3756 process_one_work+0x94c/0x1670 kernel/workqueue.c:2269 worker_thread+0x64c/0x1120 kernel/workqueue.c:2415 kthread+0x3b5/0x4a0 kernel/kthread.c:292 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294 Last call_rcu(): kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48 kasan_record_aux_stack+0x82/0xb0 mm/kasan/generic.c:346 __call_rcu kernel/rcu/tree.c:2883 [inline] call_rcu+0x14f/0x7e0 kernel/rcu/tree.c:2957 __percpu_ref_switch_to_atomic lib/percpu-refcount.c:192 [inline] __percpu_ref_switch_mode+0x365/0x700 lib/percpu-refcount.c:237 percpu_ref_kill_and_confirm+0x94/0x350 lib/percpu-refcount.c:350 percpu_ref_kill include/linux/percpu-refcount.h:136 [inline] io_ring_ctx_wait_and_kill+0x38/0x600 fs/io_uring.c:7799 io_uring_release+0x3e/0x50 fs/io_uring.c:7831 __fput+0x285/0x920 fs/file_table.c:281 task_work_run+0xdd/0x190 kernel/task_work.c:135 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_user_mode_loop kernel/entry/common.c:139 [inline] exit_to_user_mode_prepare+0x195/0x1c0 kernel/entry/common.c:166 syscall_exit_to_user_mode+0x59/0x2b0 kernel/entry/common.c:241 entry_SYSCALL_64_after_hwframe+0x44/0xa9 The buggy address belongs to the object at ffff888087a41000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 68 bytes inside of 2048-byte region [ffff888087a41000, ffff888087a41800) The buggy address belongs to the page: page:000000007a29a6b9 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x87a41 flags: 0xfffe0000000200(slab) raw: 00fffe0000000200 ffffea0002386288 ffffea000253c0c8 ffff8880aa000800 raw: 0000000000000000 ffff888087a41000 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888087a40f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888087a40f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888087a41000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888087a41080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888087a41100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== --- 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 syzkaller@googlegroups.com. syzbot will keep track of this issue. See: https://goo.gl/tpsmEJ#status for how to communicate with syzbot.