From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id D2FDBC19F28 for ; Wed, 27 Jul 2022 14:11:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EBB9194001B; Wed, 27 Jul 2022 10:11:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E6A6B940012; Wed, 27 Jul 2022 10:11:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D326A94001B; Wed, 27 Jul 2022 10:11:28 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id C3726940012 for ; Wed, 27 Jul 2022 10:11:28 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 81AA71C5C4E for ; Wed, 27 Jul 2022 14:11:28 +0000 (UTC) X-FDA: 79733067456.13.DBFB19A Received: from mail-io1-f69.google.com (mail-io1-f69.google.com [209.85.166.69]) by imf28.hostedemail.com (Postfix) with ESMTP id AB596C00B0 for ; Wed, 27 Jul 2022 14:11:27 +0000 (UTC) Received: by mail-io1-f69.google.com with SMTP id a20-20020a5d9594000000b0067c9f95d592so2861752ioo.9 for ; Wed, 27 Jul 2022 07:11:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:date:message-id:subject:from:to; bh=hZtd4Izi2z080yCo5sMjWoDMgDbQK9/2DLyH2BKw3Eg=; b=Ir5sdYlZIIAi1jTO9UYXfeDBU4az0YMkioduHibj//Kzp12GY+oS+pdg9ke3gNKdN2 f7VcEC5h43lapTw3kEETNOZQRBJVY9spCb5KxkbNUnhxKAmJ379c2a8HdybBclpYQsXt TG5ILlTNEYmCt7+0vVyvcFfDzDh3MWrv5XYPhCLYMAKH76wzttTuCLXXP4HWwbznJ0z7 RiVsHNfkShlrWv/fHp59EYnk42Y0gJvK0MCHoj7T7eloojclSKq5nj++31dbHnPmmFv0 Aw0gFZ/sJtj2SZz4PNWUOFFsDIPpGLzxVk74ISLJnizbu+Ev+XOuoUWzAvpHLa4Hkhwa RjUQ== X-Gm-Message-State: AJIora/xKTLe6ioqTtugAAfc62gutbdTG0y08z+0ljSr2IELPSQuq7ct bZeHJKPBXRMIW4S/wF50OidFYKtqM93Oh2xDAF1FD7QceFBk X-Google-Smtp-Source: AGRyM1uwbU8NMSa5gTYB6VWi8lhth8sP6ANPTBk0CJHSQR/jjzNwWyJ1B6qoWsRQ6/HbEaiERFa/gbjmusFs2SEY2JvZpPADKC/W MIME-Version: 1.0 X-Received: by 2002:a05:6638:ac1:b0:341:830e:d439 with SMTP id m1-20020a0566380ac100b00341830ed439mr9078503jab.132.1658931087023; Wed, 27 Jul 2022 07:11:27 -0700 (PDT) Date: Wed, 27 Jul 2022 07:11:27 -0700 X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <00000000000026269d05e4c9fe23@google.com> Subject: [syzbot] KASAN: use-after-free Read in exit_mmap From: syzbot To: akpm@linux-foundation.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, syzkaller-bugs@googlegroups.com Content-Type: text/plain; charset="UTF-8" ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=none; spf=pass (imf28.hostedemail.com: domain of 3j0fhYgkbAMAy45qgrrkxgvvoj.muumrk0ykxiutzktz.ius@M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com designates 209.85.166.69 as permitted sender) smtp.mailfrom=3j0fhYgkbAMAy45qgrrkxgvvoj.muumrk0ykxiutzktz.ius@M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=appspotmail.com (policy=none) ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1658931088; a=rsa-sha256; cv=none; b=Fp1VhY5l0fVA4kahkeKszJaMz63r2HHs9Uii3G6gnAZ74m/vkUH8IsK49vKBpp76sG6rjV /ODN9xzNew7lrToiH+iNo1XZo4xcnQ9OtNZi/HKO7qKKKaTNDtYnsal/Yx4nFq1lP2lbC/ HcSnp+n12ndmJ0E6PB8232WfaZehJRc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1658931088; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding:in-reply-to: references; bh=hZtd4Izi2z080yCo5sMjWoDMgDbQK9/2DLyH2BKw3Eg=; b=JL0F4w+zJcXIfX/UzRVpPYtVAmdfFukuDOHnI/1+kjDxDYla7iIA+3iohGY8K3yl3sMpPl j5xPm2tgXm7Rwc6xQFw/Axm3JKVPH60Lno8v2RRGE7bQfPe7OpOB6d2bFvTkaGNQ9qzFNL N/Hn9eF79nkMIVWaFPhU0xtT01BxNDk= X-Stat-Signature: cy845yhnd4zwd6mgtc3s3taj881fswae X-Rspamd-Queue-Id: AB596C00B0 X-Rspam-User: Authentication-Results: imf28.hostedemail.com; dkim=none; spf=pass (imf28.hostedemail.com: domain of 3j0fhYgkbAMAy45qgrrkxgvvoj.muumrk0ykxiutzktz.ius@M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com designates 209.85.166.69 as permitted sender) smtp.mailfrom=3j0fhYgkbAMAy45qgrrkxgvvoj.muumrk0ykxiutzktz.ius@M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=appspotmail.com (policy=none) X-Rspamd-Server: rspam12 X-HE-Tag: 1658931087-802097 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Hello, syzbot found the following issue on: HEAD commit: cb71b93c2dc3 Add linux-next specific files for 20220628 git tree: linux-next console+strace: https://syzkaller.appspot.com/x/log.txt?x=16c0a5ba080000 kernel config: https://syzkaller.appspot.com/x/.config?x=badbc1adb2d582eb dashboard link: https://syzkaller.appspot.com/bug?extid=99551d8b4d180f6cb1c0 compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2 syz repro: https://syzkaller.appspot.com/x/repro.syz?x=117dc816080000 C reproducer: https://syzkaller.appspot.com/x/repro.c?x=12695b26080000 IMPORTANT: if you fix the issue, please add the following tag to the commit: Reported-by: syzbot+99551d8b4d180f6cb1c0@syzkaller.appspotmail.com ================================================================== BUG: KASAN: use-after-free in exit_mmap+0x6b1/0x720 mm/mmap.c:3220 Read of size 8 at addr ffff88801fa79cc8 by task syz-executor422/3601 CPU: 0 PID: 3601 Comm: syz-executor422 Not tainted 5.19.0-rc4-next-20220628-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/29/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:317 [inline] print_report.cold+0x2ba/0x719 mm/kasan/report.c:433 kasan_report+0xbe/0x1f0 mm/kasan/report.c:495 exit_mmap+0x6b1/0x720 mm/mmap.c:3220 __mmput+0x128/0x4c0 kernel/fork.c:1180 mmput+0x5c/0x70 kernel/fork.c:1201 exit_mm kernel/exit.c:510 [inline] do_exit+0xa09/0x29f0 kernel/exit.c:782 do_group_exit+0xd2/0x2f0 kernel/exit.c:925 __do_sys_exit_group kernel/exit.c:936 [inline] __se_sys_exit_group kernel/exit.c:934 [inline] __x64_sys_exit_group+0x3a/0x50 kernel/exit.c:934 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 RIP: 0033:0x7f39b4e776a9 Code: Unable to access opcode bytes at RIP 0x7f39b4e7767f. RSP: 002b:00007ffe5f9ced98 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 RAX: ffffffffffffffda RBX: 00007f39b4eeb270 RCX: 00007f39b4e776a9 RDX: 000000000000003c RSI: 00000000000000e7 RDI: 0000000000000000 RBP: 0000000000000000 R08: ffffffffffffffc0 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f39b4eeb270 R13: 0000000000000001 R14: 0000000000000000 R15: 0000000000000001 Allocated by task 3601: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:436 [inline] __kasan_slab_alloc+0x90/0xc0 mm/kasan/common.c:469 kasan_slab_alloc include/linux/kasan.h:224 [inline] slab_post_alloc_hook mm/slab.h:736 [inline] slab_alloc_node mm/slub.c:3243 [inline] slab_alloc mm/slub.c:3251 [inline] __kmem_cache_alloc_lru mm/slub.c:3258 [inline] kmem_cache_alloc+0x2d6/0x4c0 mm/slub.c:3268 vm_area_alloc+0x1c/0xf0 kernel/fork.c:458 mmap_region+0x448/0x1bf0 mm/mmap.c:2667 do_mmap+0x825/0xf50 mm/mmap.c:1483 vm_mmap_pgoff+0x1ab/0x270 mm/util.c:520 ksys_mmap_pgoff+0x79/0x5a0 mm/mmap.c:1529 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 Freed by task 3601: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track+0x21/0x30 mm/kasan/common.c:45 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:370 ____kasan_slab_free mm/kasan/common.c:366 [inline] ____kasan_slab_free+0x166/0x1c0 mm/kasan/common.c:328 kasan_slab_free include/linux/kasan.h:200 [inline] slab_free_hook mm/slub.c:1754 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1780 slab_free mm/slub.c:3534 [inline] kmem_cache_free+0xeb/0x5b0 mm/slub.c:3551 exit_mmap+0x288/0x720 mm/mmap.c:3222 __mmput+0x128/0x4c0 kernel/fork.c:1180 mmput+0x5c/0x70 kernel/fork.c:1201 exit_mm kernel/exit.c:510 [inline] do_exit+0xa09/0x29f0 kernel/exit.c:782 do_group_exit+0xd2/0x2f0 kernel/exit.c:925 __do_sys_exit_group kernel/exit.c:936 [inline] __se_sys_exit_group kernel/exit.c:934 [inline] __x64_sys_exit_group+0x3a/0x50 kernel/exit.c:934 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 The buggy address belongs to the object at ffff88801fa79ca8 which belongs to the cache vm_area_struct of size 152 The buggy address is located 32 bytes inside of 152-byte region [ffff88801fa79ca8, ffff88801fa79d40) The buggy address belongs to the physical page: page:ffffea00007e9e40 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1fa79 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 0000000000000000 dead000000000122 ffff888140006b40 raw: 0000000000000000 0000000080120012 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x12cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY), pid 3596, tgid 3596 (sshd), ts 49436343226, free_ts 44111523441 prep_new_page mm/page_alloc.c:2535 [inline] get_page_from_freelist+0x210d/0x3a30 mm/page_alloc.c:4282 __alloc_pages+0x1c7/0x510 mm/page_alloc.c:5506 alloc_pages+0x1aa/0x310 mm/mempolicy.c:2280 alloc_slab_page mm/slub.c:1824 [inline] allocate_slab+0x27e/0x3d0 mm/slub.c:1969 new_slab mm/slub.c:2029 [inline] ___slab_alloc+0x89d/0xef0 mm/slub.c:3031 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3118 slab_alloc_node mm/slub.c:3209 [inline] slab_alloc mm/slub.c:3251 [inline] __kmem_cache_alloc_lru mm/slub.c:3258 [inline] kmem_cache_alloc+0x3fb/0x4c0 mm/slub.c:3268 vm_area_dup+0x81/0x380 kernel/fork.c:466 dup_mmap+0x642/0x1070 kernel/fork.c:640 dup_mm+0x91/0x370 kernel/fork.c:1520 copy_mm kernel/fork.c:1569 [inline] copy_process+0x3ca8/0x7080 kernel/fork.c:2237 kernel_clone+0xe7/0xab0 kernel/fork.c:2652 __do_sys_clone+0xba/0x100 kernel/fork.c:2786 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1453 [inline] free_pcp_prepare+0x5e4/0xd20 mm/page_alloc.c:1503 free_unref_page_prepare mm/page_alloc.c:3383 [inline] free_unref_page_list+0x16f/0xb90 mm/page_alloc.c:3525 release_pages+0xbe8/0x1810 mm/swap.c:1017 tlb_batch_pages_flush+0xa8/0x1a0 mm/mmu_gather.c:58 tlb_flush_mmu_free mm/mmu_gather.c:255 [inline] tlb_flush_mmu mm/mmu_gather.c:262 [inline] tlb_finish_mmu+0x147/0x7e0 mm/mmu_gather.c:353 exit_mmap+0x1fe/0x720 mm/mmap.c:3212 __mmput+0x128/0x4c0 kernel/fork.c:1180 mmput+0x5c/0x70 kernel/fork.c:1201 exit_mm kernel/exit.c:510 [inline] do_exit+0xa09/0x29f0 kernel/exit.c:782 do_group_exit+0xd2/0x2f0 kernel/exit.c:925 __do_sys_exit_group kernel/exit.c:936 [inline] __se_sys_exit_group kernel/exit.c:934 [inline] __x64_sys_exit_group+0x3a/0x50 kernel/exit.c:934 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 Memory state around the buggy address: ffff88801fa79b80: 00 00 fc fc fc fc fc fc fc fc fa fb fb fb fb fb ffff88801fa79c00: fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc >ffff88801fa79c80: fc fc fc fc fc fa fb fb fb fb fb fb fb fb fb fb ^ ffff88801fa79d00: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88801fa79d80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== --- 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