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 X-Spam-Level: X-Spam-Status: No, score=-8.7 required=3.0 tests=BAYES_00,FROM_LOCAL_HEX, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B9171C432BE for ; Fri, 20 Aug 2021 09:18:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 96BCD610E6 for ; Fri, 20 Aug 2021 09:18:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236259AbhHTJS7 (ORCPT ); Fri, 20 Aug 2021 05:18:59 -0400 Received: from mail-io1-f71.google.com ([209.85.166.71]:52977 "EHLO mail-io1-f71.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235063AbhHTJS5 (ORCPT ); Fri, 20 Aug 2021 05:18:57 -0400 Received: by mail-io1-f71.google.com with SMTP id n22-20020a6bf6160000b0290520c8d13420so5051672ioh.19 for ; Fri, 20 Aug 2021 02:18:19 -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=klpds5T+BVnKDxwQfgde5Ruga8lw8fM9KzndfRF2hYI=; b=UsoNT2+R6ail+F7eZubd3hnMrIZVFqNmdXA/BTLt99bV4CnYWgq3StEeCpVgS/x5My Zmstg+OHPa/D/GdxIca+fpSNaSu+qgxYGphXeWqXfp/1d5+GGZ/2XxpMEL3HqhKz3YUs jRxcyI9ekSKWka+t8tq37Qn3TtGdmcBJF70dxSZ6BbTx5jBw5kALrnO1Mh/CEwfH19b6 tR3/6fr8f5bKaADaFoZlbW+U3egpx1ADZNgHtbgNQ/XUymJo5lnEOp1coMsVjRe5RJRA GWW6idDWquhNE8b04JuHD6dwriHIinQkyjL5B2xXX/dFEXwKgqyuNsOIA4EgFEE5P13k 2vTQ== X-Gm-Message-State: AOAM531+ln5oKXdR1/M6zWwsFM/Wb/YRti/pPeRalY4djG7vI+2kTEam meLc9l4qpBP3UqVJ2HxPM3BQnKW+8nNC9BtIAO/E987gnomg X-Google-Smtp-Source: ABdhPJylV48gv+oQiugYq4pMyfopzJmlDqmby+b/HBcp/bwuOd16+TI764Yo8TR6qBSSjQZyIRsI77VAUFCHwXPWouBBKgH57gvu MIME-Version: 1.0 X-Received: by 2002:a05:6638:22d5:: with SMTP id j21mr17125127jat.119.1629451099380; Fri, 20 Aug 2021 02:18:19 -0700 (PDT) Date: Fri, 20 Aug 2021 02:18:19 -0700 X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <000000000000f523b005c9fa252c@google.com> Subject: [syzbot] KASAN: use-after-free Read in ext4_find_extent From: syzbot To: adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com, tytso@mit.edu 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: 614cb2751d31 Merge tag 'trace-v5.14-rc6' of git://git.kern.. git tree: upstream console output: https://syzkaller.appspot.com/x/log.txt?x=164bc961300000 kernel config: https://syzkaller.appspot.com/x/.config?x=f61012d0b1cd846f dashboard link: https://syzkaller.appspot.com/bug?extid=333dc3792ca8ce20b80c compiler: Debian clang version 11.0.1-2, GNU ld (GNU Binutils for Debian) 2.35.1 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+333dc3792ca8ce20b80c@syzkaller.appspotmail.com ================================================================== BUG: KASAN: use-after-free in ext4_ext_binsearch fs/ext4/extents.c:784 [inline] BUG: KASAN: use-after-free in ext4_find_extent+0xae9/0xcc0 fs/ext4/extents.c:904 Read of size 4 at addr ffff888043db6024 by task kworker/u4:11/12775 CPU: 0 PID: 12775 Comm: kworker/u4:11 Not tainted 5.14.0-rc6-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: writeback wb_workfn (flush-7:5) Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1ae/0x29f lib/dump_stack.c:105 print_address_description+0x66/0x3b0 mm/kasan/report.c:233 __kasan_report mm/kasan/report.c:419 [inline] kasan_report+0x163/0x210 mm/kasan/report.c:436 ext4_ext_binsearch fs/ext4/extents.c:784 [inline] ext4_find_extent+0xae9/0xcc0 fs/ext4/extents.c:904 ext4_ext_map_blocks+0x1e7/0x7210 fs/ext4/extents.c:4061 ext4_map_blocks+0xab3/0x1cb0 fs/ext4/inode.c:638 mpage_map_one_extent fs/ext4/inode.c:2395 [inline] mpage_map_and_submit_extent fs/ext4/inode.c:2448 [inline] ext4_writepages+0x1797/0x3f30 fs/ext4/inode.c:2800 do_writepages+0x12e/0x2b0 mm/page-writeback.c:2355 __writeback_single_inode+0xd4/0x590 fs/fs-writeback.c:1613 writeback_sb_inodes+0xd8e/0x2b80 fs/fs-writeback.c:1878 wb_writeback+0x423/0x9c0 fs/fs-writeback.c:2051 wb_do_writeback fs/fs-writeback.c:2196 [inline] wb_workfn+0x41b/0x13c0 fs/fs-writeback.c:2237 process_one_work+0x833/0x10c0 kernel/workqueue.c:2276 worker_thread+0xac1/0x1320 kernel/workqueue.c:2422 kthread+0x453/0x480 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 The buggy address belongs to the page: page:ffffea00010f6d80 refcount:0 mapcount:0 mapping:0000000000000000 index:0x100 pfn:0x43db6 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 ffffea0001189248 ffffea00015da888 0000000000000000 raw: 0000000000000100 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 0, migratetype Movable, gfp_mask 0x1101cca(GFP_HIGHUSER_MOVABLE|__GFP_WRITE), pid 20166, ts 379239124786, free_ts 380213300070 prep_new_page mm/page_alloc.c:2436 [inline] get_page_from_freelist+0x779/0xa30 mm/page_alloc.c:4169 __alloc_pages+0x26c/0x5f0 mm/page_alloc.c:5391 __page_cache_alloc+0x79/0x1c0 mm/filemap.c:1005 pagecache_get_page+0x85e/0xf70 mm/filemap.c:1885 grab_cache_page_write_begin+0x50/0x90 mm/filemap.c:3610 ext4_da_write_begin+0x539/0x10c0 fs/ext4/inode.c:2984 generic_perform_write+0x262/0x580 mm/filemap.c:3656 ext4_buffered_write_iter+0x41c/0x590 fs/ext4/file.c:269 ext4_file_write_iter+0x8f7/0x1b90 fs/ext4/file.c:519 call_write_iter include/linux/fs.h:2114 [inline] new_sync_write fs/read_write.c:518 [inline] vfs_write+0xa39/0xc90 fs/read_write.c:605 ksys_write+0x171/0x2a0 fs/read_write.c:658 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1346 [inline] free_pcp_prepare+0xc29/0xd20 mm/page_alloc.c:1397 free_unref_page_prepare mm/page_alloc.c:3332 [inline] free_unref_page_list+0x118/0xad0 mm/page_alloc.c:3448 release_pages+0x18bb/0x1af0 mm/swap.c:972 __pagevec_release+0x7d/0xf0 mm/swap.c:992 pagevec_release include/linux/pagevec.h:81 [inline] truncate_inode_pages_range+0x472/0x12d0 mm/truncate.c:329 ext4_evict_inode+0x424/0xf70 fs/ext4/inode.c:223 evict+0x2a4/0x620 fs/inode.c:584 do_unlinkat+0x528/0x990 fs/namei.c:4109 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Memory state around the buggy address: ffff888043db5f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888043db5f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff888043db6000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888043db6080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888043db6100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ================================================================== --- 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.