Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp687414pxb; Tue, 3 Nov 2020 09:46:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJyaC7btYEbDeuw87KLkR+nLdwi2GZEOEydQk0YTmyUUGqwJgsA067F26eYGyHhSTAwLOEdu X-Received: by 2002:a17:907:4186:: with SMTP id mz6mr20969049ejb.175.1604425589165; Tue, 03 Nov 2020 09:46:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604425589; cv=none; d=google.com; s=arc-20160816; b=fBD/0DFWCVGFdkWX/v+qNdAPcs1IeMJvyeIYTCv8v2VkzTDawVekutgOpXPtnNv7fR hTa+CQLySAI7SgwgnAE5DDp43aZJPg4YmzZwunZvDtGOMDGRGKSzmhci/nGHf3ZuWrBb 5nXDewzi5mJkyWZHz0nfMPu2jhspHb8qEuiThn1dyD3Ya7fZOhCmo8e/4E+k9HrzkZtw /N5sHbzACGiBmIRFQIpgpAqpSUQv43pJdy8ISgrP5PJFNkjD1nqr5TH/L8k6gluZSdUX jBs5l1OCuWXq7YHONKmfOr+889nsIqYhG6d+9NED9eyUuidL6KEqUK2rO7T0ue/UTAMJ j5/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:from:subject:message-id:date:mime-version; bh=cOp2atVuyrM4HQesHV0mHLyZ8BWipQWU0PDBlpE2oIs=; b=OOK8po//ms6A1MnCUeZ8JYELwoRjD2wJcBoP7koToQuasL8MLc53WKXZoH/RcsSQrk Ur4/k3QaHD3/7/On/iqaTtp6s9Rd5QI03KVTPwDx4XiqmVhPS/LwBl3+w1d0AgW5zfcB wXgvaQfunGXbweNeMu0nvm7RsvTJCnnofaHs6SoVwwd4eD3OjgaAJJY+w9dIASVV1ria /rkuIIOikiycSFn41XeEvSnK9w8jTg1YgmQbaRIFuZgNPmWp52BZr90vsxnop8WLSxFX zuFtnAifMql9lP2cR2A/rkMF6V7WTw7nr4eefZtMPxtTSAIYNeOVqrGViX3Ofzom09qN mgMQ== 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 e3si12588605eja.411.2020.11.03.09.46.06; Tue, 03 Nov 2020 09:46:29 -0800 (PST) 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 S1729039AbgKCRn1 (ORCPT + 99 others); Tue, 3 Nov 2020 12:43:27 -0500 Received: from mail-io1-f71.google.com ([209.85.166.71]:53524 "EHLO mail-io1-f71.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729001AbgKCRn1 (ORCPT ); Tue, 3 Nov 2020 12:43:27 -0500 Received: by mail-io1-f71.google.com with SMTP id c17so11001800iom.20 for ; Tue, 03 Nov 2020 09:43:26 -0800 (PST) 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=cOp2atVuyrM4HQesHV0mHLyZ8BWipQWU0PDBlpE2oIs=; b=IchuDe8z62k6uvy20crr2Yh+8dcNEP2BQIPSKwIuIGxdAnXtaLVcwdEbU0fKY+5N2J ObQ0VT6I2L2uq0nnOfTM4AhknER9AbF/SjCMwxAhqKHcdR22ZOiVcM2Sn1K/Fxv00NKp TXh53prRr+kXfec64ER6kzkO7Dqno8uuVrFeOrDSr5af9mgmImhunx8V08m7grncb1Tv G1FK+QQxwmkYOCxM24yIvf5wen8ibc5QalFDgEweRLLPbBToLBhf+YnlmmAEbTVdXnPl maYCxDBaBgRMRjxkNs+KSa6qZUwLzsDm0mrS9rCeV+pyEgMKYcScYZEKJfEghD7vbqrx 7Eyg== X-Gm-Message-State: AOAM5322b+ehLa4pUyO95SeQxlPQ0MAe21CKZ8oYbQOZs+ycOsz/oaCy yU+YOf25+6rZQuiLfFZWNO9hWOGawhBHp8T+wwgVXPV7sDzk MIME-Version: 1.0 X-Received: by 2002:a92:850f:: with SMTP id f15mr3146516ilh.286.1604425405855; Tue, 03 Nov 2020 09:43:25 -0800 (PST) Date: Tue, 03 Nov 2020 09:43:25 -0800 X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <000000000000627c8805b33766e9@google.com> Subject: KASAN: use-after-free Write in io_submit_sqes 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" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, syzbot found the following issue on: HEAD commit: b49976d8 Add linux-next specific files for 20201102 git tree: linux-next console output: https://syzkaller.appspot.com/x/log.txt?x=16a02732500000 kernel config: https://syzkaller.appspot.com/x/.config?x=fe87d079ac78e2be dashboard link: https://syzkaller.appspot.com/bug?extid=625ce3bb7835b63f7f3d compiler: gcc (GCC) 10.1.0-syz 20200507 syz repro: https://syzkaller.appspot.com/x/repro.syz?x=12de9346500000 C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1213fda8500000 IMPORTANT: if you fix the issue, please add the following tag to the commit: Reported-by: syzbot+625ce3bb7835b63f7f3d@syzkaller.appspotmail.com IPVS: ftp: loaded support on port[0] = 21 ================================================================== BUG: KASAN: use-after-free in instrument_atomic_read_write include/linux/instrumented.h:101 [inline] BUG: KASAN: use-after-free in atomic_fetch_add_relaxed include/asm-generic/atomic-instrumented.h:142 [inline] BUG: KASAN: use-after-free in __refcount_add include/linux/refcount.h:193 [inline] BUG: KASAN: use-after-free in __refcount_inc include/linux/refcount.h:250 [inline] BUG: KASAN: use-after-free in refcount_inc include/linux/refcount.h:267 [inline] BUG: KASAN: use-after-free in io_init_req fs/io_uring.c:6700 [inline] BUG: KASAN: use-after-free in io_submit_sqes+0x15a9/0x25f0 fs/io_uring.c:6774 Write of size 4 at addr ffff888011e08e48 by task syz-executor165/8487 CPU: 1 PID: 8487 Comm: syz-executor165 Not tainted 5.10.0-rc1-next-20201102-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+0x107/0x163 lib/dump_stack.c:118 print_address_description.constprop.0.cold+0xae/0x4c8 mm/kasan/report.c:385 __kasan_report mm/kasan/report.c:545 [inline] kasan_report.cold+0x1f/0x37 mm/kasan/report.c:562 check_memory_region_inline mm/kasan/generic.c:186 [inline] check_memory_region+0x13d/0x180 mm/kasan/generic.c:192 instrument_atomic_read_write include/linux/instrumented.h:101 [inline] atomic_fetch_add_relaxed include/asm-generic/atomic-instrumented.h:142 [inline] __refcount_add include/linux/refcount.h:193 [inline] __refcount_inc include/linux/refcount.h:250 [inline] refcount_inc include/linux/refcount.h:267 [inline] io_init_req fs/io_uring.c:6700 [inline] io_submit_sqes+0x15a9/0x25f0 fs/io_uring.c:6774 __do_sys_io_uring_enter+0xc8e/0x1b50 fs/io_uring.c:9159 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x440e19 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 eb 0f fc ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007fff644ff178 EFLAGS: 00000246 ORIG_RAX: 00000000000001aa RAX: ffffffffffffffda RBX: 0000000000000005 RCX: 0000000000440e19 RDX: 0000000000000000 RSI: 000000000000450c RDI: 0000000000000003 RBP: 0000000000000004 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000022b4850 R13: 0000000000000010 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 8487: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48 kasan_set_track mm/kasan/common.c:56 [inline] __kasan_kmalloc.constprop.0+0xc2/0xd0 mm/kasan/common.c:461 kmalloc include/linux/slab.h:552 [inline] io_register_personality fs/io_uring.c:9638 [inline] __io_uring_register fs/io_uring.c:9874 [inline] __do_sys_io_uring_register+0x10f0/0x40a0 fs/io_uring.c:9924 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Freed by task 8487: 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+0x102/0x140 mm/kasan/common.c:422 slab_free_hook mm/slub.c:1544 [inline] slab_free_freelist_hook+0x5d/0x150 mm/slub.c:1577 slab_free mm/slub.c:3140 [inline] kfree+0xdb/0x360 mm/slub.c:4122 io_identity_cow fs/io_uring.c:1380 [inline] io_prep_async_work+0x903/0xbc0 fs/io_uring.c:1492 io_prep_async_link fs/io_uring.c:1505 [inline] io_req_defer fs/io_uring.c:5999 [inline] io_queue_sqe+0x212/0xed0 fs/io_uring.c:6448 io_submit_sqe fs/io_uring.c:6542 [inline] io_submit_sqes+0x14f6/0x25f0 fs/io_uring.c:6784 __do_sys_io_uring_enter+0xc8e/0x1b50 fs/io_uring.c:9159 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 The buggy address belongs to the object at ffff888011e08e00 which belongs to the cache kmalloc-96 of size 96 The buggy address is located 72 bytes inside of 96-byte region [ffff888011e08e00, ffff888011e08e60) The buggy address belongs to the page: page:00000000a7104751 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11e08 flags: 0xfff00000000200(slab) raw: 00fff00000000200 ffffea00004f8540 0000001f00000002 ffff888010041780 raw: 0000000000000000 0000000080200020 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888011e08d00: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc ffff888011e08d80: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc >ffff888011e08e00: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ^ ffff888011e08e80: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc ffff888011e08f00: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc ================================================================== --- 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. syzbot can test patches for this issue, for details see: https://goo.gl/tpsmEJ#testing-patches