Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp655969ybh; Sun, 12 Jul 2020 19:26:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwZqhXSS53KwSXr5wvYSXdNiHRE5wtIGa5A7XVivwgKauyw+xVapMxonGDXJ+PDdkHf/UZT X-Received: by 2002:a05:6402:1c8f:: with SMTP id cy15mr89576319edb.308.1594607218378; Sun, 12 Jul 2020 19:26:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594607218; cv=none; d=google.com; s=arc-20160816; b=SspxKZANlzZhGu0rJB0AX6zlBGAZ/Gi2E5pTmjDn6YDX4UvO40efi6+dz91bNT4ooj OEGmW6B8N6VyMnHpFmHSaFpRj8TpKnmo4fBDo9+tipQwMstZqaVgslMBV9y1XdAGLKLk i649QP1dOEjzYmYod/M3HZuvzRbAXFEM0OBc/byck5X18NVd1Bu/6DB6WuWbyjnV0cai Lj7PhH/H+MsONihPRXKLwmJkrF3NYlW+CgdjZC4rsLZpT/bwSQjKcwGBxxOF88P8dUn2 plPfd5ev5bfj7yW7j9MGGbyVZHv7Ixj46z2Hh7ZKJkDP4FXZzMPlNzygqz7UH4qAHOzP QURg== 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=oeDO3uGOlGXCY3ZqE1/B/SxjjNdp+6TXbFewQjpCefw=; b=G7/UE+dQqp3fc0iObzhmKgQiVglSoEbHT4Ss/Gcx9bQqc2Rx/quZLkGC+E4q9p5NX9 9HW1/vr5gjiAIy35GhNxiMVJ0g6cIg78pDte5XiKd9PdzEZ2Kqxh2Q6YvRP+dXWuWgFC gpACjnEXb9VWFctHp+vN0wOhsAnsInTGmdz/JNfpq3mCL0W629QwkJtc560ngx+LWMPa cs2WngtwNpeyQx5c0Ph6uS9oTmaZvp1rJnHG6AylzGtm+W6mFGUz9Bl5gugWBqfI/2hI htXVrcZREmFQnHHSSfH9vCfiL2kM4A12msTwOtZjcGBPBkrfqE3917yeBYmQJrwlka4a mTCQ== 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 27si9287508edv.33.2020.07.12.19.26.35; Sun, 12 Jul 2020 19:26:58 -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 S1728198AbgGMCYR (ORCPT + 99 others); Sun, 12 Jul 2020 22:24:17 -0400 Received: from mail-il1-f200.google.com ([209.85.166.200]:45057 "EHLO mail-il1-f200.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726261AbgGMCYQ (ORCPT ); Sun, 12 Jul 2020 22:24:16 -0400 Received: by mail-il1-f200.google.com with SMTP id c1so8563286ilk.12 for ; Sun, 12 Jul 2020 19:24:15 -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=oeDO3uGOlGXCY3ZqE1/B/SxjjNdp+6TXbFewQjpCefw=; b=gBNYmtHTYkIjzfz10p2yaxygEm3IuEUHOvqUqdU8NLJ5Lmix+HisWFq/R9s5bjisnV /Ly207fl/bVBNy8MnFErw0iMOhmfmxcH5E57Y3iQzW2MdzaJmVHkNzbtJBURBkrmmZBf qDBaq8CGjS3ktae3EtVSpvpgLwi5m2LjIf2c7UZZ08ChCjw+8oFI0OSJR0UWKOoyY9DU 5oj1T2TGx1WjuDscE/bXrVhH2qQoZZ5x6iXWT0+1zcr3SOJMJjY6TW4X38dU1AEaQs7d 8epCh08rBl6HyvJqDiut7XsTqvkKCfRH1t+SitRpFA3Z6YIF6QlA8bc+bp1XbHzXk6ML zEEg== X-Gm-Message-State: AOAM53208ewHWkHkF5rrinRm6GQ8Nfp/Oj0Rymfk+yOTf3HKjgq0cI3k cjjTmkF/lfYzHi/0W7Uqbaab/lEZMnTDpNyULN0+G8Ga8m8Z MIME-Version: 1.0 X-Received: by 2002:a02:b897:: with SMTP id p23mr7141821jam.32.1594607055648; Sun, 12 Jul 2020 19:24:15 -0700 (PDT) Date: Sun, 12 Jul 2020 19:24:15 -0700 X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <0000000000001bbb6705aa49635a@google.com> Subject: KASAN: use-after-free Read in userfaultfd_release (2) From: syzbot To: 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 crash on: HEAD commit: 89032636 Add linux-next specific files for 20200708 git tree: linux-next console output: https://syzkaller.appspot.com/x/log.txt?x=1028732f100000 kernel config: https://syzkaller.appspot.com/x/.config?x=64a250ebabc6c320 dashboard link: https://syzkaller.appspot.com/bug?extid=75867c44841cb6373570 compiler: gcc (GCC) 10.1.0-syz 20200507 syz repro: https://syzkaller.appspot.com/x/repro.syz?x=13c4c8db100000 C reproducer: https://syzkaller.appspot.com/x/repro.c?x=12cbb68f100000 IMPORTANT: if you fix the bug, please add the following tag to the commit: Reported-by: syzbot+75867c44841cb6373570@syzkaller.appspotmail.com ================================================================== BUG: KASAN: use-after-free in userfaultfd_release+0x57f/0x5f0 fs/userfaultfd.c:879 Read of size 8 at addr ffff88809b09af88 by task syz-executor902/6813 CPU: 0 PID: 6813 Comm: syz-executor902 Not tainted 5.8.0-rc4-next-20200708-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 userfaultfd_release+0x57f/0x5f0 fs/userfaultfd.c:879 __fput+0x33c/0x880 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_usermode_loop arch/x86/entry/common.c:239 [inline] __prepare_exit_to_usermode+0x1e9/0x1f0 arch/x86/entry/common.c:269 do_syscall_64+0x6c/0xe0 arch/x86/entry/common.c:393 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x4401f9 Code: Bad RIP value. RSP: 002b:00007ffdd722dfe8 EFLAGS: 00000246 ORIG_RAX: 0000000000000143 RAX: ffffffffffffffe8 RBX: 00000000004002c8 RCX: 00000000004401f9 RDX: 00000000004401f9 RSI: 0000000000400aa0 RDI: 0000000000000000 RBP: 00000000006ca018 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000401a00 R13: 0000000000401a90 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 6813: 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 slab_post_alloc_hook mm/slab.h:536 [inline] slab_alloc mm/slab.c:3312 [inline] kmem_cache_alloc+0x148/0x550 mm/slab.c:3482 __do_sys_userfaultfd+0x96/0x4b0 fs/userfaultfd.c:2026 do_syscall_64+0x60/0xe0 arch/x86/entry/common.c:384 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Freed by task 6813: 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] kmem_cache_free.part.0+0x67/0x1f0 mm/slab.c:3693 __do_sys_userfaultfd+0x3cf/0x4b0 fs/userfaultfd.c:2061 do_syscall_64+0x60/0xe0 arch/x86/entry/common.c:384 entry_SYSCALL_64_after_hwframe+0x44/0xa9 The buggy address belongs to the object at ffff88809b09ae00 which belongs to the cache userfaultfd_ctx_cache of size 408 The buggy address is located 392 bytes inside of 408-byte region [ffff88809b09ae00, ffff88809b09af98) The buggy address belongs to the page: page:ffffea00026c2680 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff8880a03d5dc0 flags: 0xfffe0000000200(slab) raw: 00fffe0000000200 ffff8880a3de5d50 ffff8880a3de5d50 ffff888219701b00 raw: ffff8880a03d5dc0 ffff88809b09a000 0000000100000008 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88809b09ae80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88809b09af00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88809b09af80: fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88809b09b000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88809b09b080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== --- This bug 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 bug report. See: https://goo.gl/tpsmEJ#status for how to communicate with syzbot. syzbot can test patches for this bug, for details see: https://goo.gl/tpsmEJ#testing-patches