Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4697370pxf; Tue, 30 Mar 2021 14:47:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyrLEpO3/23qVoalrsCVAVXDe7qXH5ZfGIgPnQuVFuMhqqF0DC8VHsRSmmb7V+joErhPdQe X-Received: by 2002:a17:906:cb18:: with SMTP id lk24mr237051ejb.70.1617140874992; Tue, 30 Mar 2021 14:47:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617140874; cv=none; d=google.com; s=arc-20160816; b=azWJSq0tdXucaQPzgEwnoMZJ+fcfo672txMliSHnaVSiURXHvp5p9jWeMFdSqj+zZh C9dAzk+MOTErB50evZ8c89i0dIPB2S7MrU5hYLZdYKVeMIPXtcnbinYehHptlBsHc4U9 F49mTZ9fS4n5egrvV60Vo1w3M6H5L/Cx0EuEw/G7zLfLIubO5Sk26xa++64fdggJZsWN iyL2W1bt98chTrr0/nW1TfWWWbIbFkLpn7IgbAnRtuA6gZ8NBc8qe4iWFy2Jr4McKgn3 rt80ASachSw1GsOgQX3Qh5jFO4d4063VN/k63/55tqy4zSeiSLG/ATLPCUXMiwpynMD5 KLAw== 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=j4vHEfDUIWjWWNIt1cQZKz6843+yacPTPceNoi6dp+k=; b=XNcrOa0SklqRdOrC7dPo8KVEeCBmcO/rfPNeXlUj1yUU/iyZaKcWjBI6IUM4Obh5BP S9rwMUCVZtCnJIgZnQwP/Lnyjq+ceVq1gH772fqkxn+eMTDvZeP0wBYA+eRdiG2iNs3i UeOadc+ioCXsjeH21+Hz/oqFYHKjvo/egaCvvNfpvEZvmSy+0PkK7YZgmxkDeB/0sN4Q 2LFHyuyiVtGIRhr6woLO5dn5Q73pzV41serm4DrvSL2gLYPg5HnFWkpSo6DZO2lAmab2 tb6D9I7YTwLVOvFq0Y5roWjkKVLvFsUmPtceBZC0SkHbJm3yv8C0Kq7DHRLEHEj3w0w8 7sjg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-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 c17si225145edr.46.2021.03.30.14.47.29; Tue, 30 Mar 2021 14:47:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-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-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-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 S232771AbhC3Vp4 (ORCPT + 99 others); Tue, 30 Mar 2021 17:45:56 -0400 Received: from mail-io1-f70.google.com ([209.85.166.70]:48695 "EHLO mail-io1-f70.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232606AbhC3VpU (ORCPT ); Tue, 30 Mar 2021 17:45:20 -0400 Received: by mail-io1-f70.google.com with SMTP id g12so107397ion.15 for ; Tue, 30 Mar 2021 14:45:20 -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=j4vHEfDUIWjWWNIt1cQZKz6843+yacPTPceNoi6dp+k=; b=ucVhnOyQ2r/lEGkKxCjYXH+/oe9L0JddZApcyOVIERSC72/amAACSzHClCsq1aVLtS rTzH/xWBmIw6reZsp9Uxg+WblE+LwHSTVB6TgSqayplkLvdQiiGK8PmSRrqo0Oa3UUlk tIFjebBXtdOFwK2tuMgaMcgj6gDAH9i7xD9/fvRyxvlD61gaeo9kdzcq44PapIvAVeCf VCCNfJJUxGBMRcls084FK8pRasGdElXErq2jzFiKcvZ6cpPQ/YcsSX0qLFuety7/nLPJ KoyjeL/8S3y7sO1wreV1JdZwO0Sjc4sxBEjiXHhDlIntE4PolAeiipGZ/7H507Cl36R9 nqbQ== X-Gm-Message-State: AOAM531XnClwfkEtXHbHxZtRpXtQc8K+xh6ay8kLRyvbq44fqKfj8D1K MDh2gRkXsInduVV9Ys6figbT+GB6wXm2K8Tj0gFd5q5Mzng6 MIME-Version: 1.0 X-Received: by 2002:a92:d784:: with SMTP id d4mr272151iln.184.1617140719719; Tue, 30 Mar 2021 14:45:19 -0700 (PDT) Date: Tue, 30 Mar 2021 14:45:19 -0700 X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <000000000000269d0705bec7ea73@google.com> Subject: [syzbot] KASAN: use-after-free Read in delete_partition (2) From: syzbot To: axboe@kernel.dk, davem@davemloft.net, hare@suse.de, hch@lst.de, jack@suse.cz, johannes.thumshirn@edc.com, johannes@sipsolutions.net, kuba@kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, richard@nod.at, syzkaller-bugs@googlegroups.com Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Hello, syzbot found the following issue on: HEAD commit: 93129492 Add linux-next specific files for 20210326 git tree: linux-next console output: https://syzkaller.appspot.com/x/log.txt?x=1372ce62d00000 kernel config: https://syzkaller.appspot.com/x/.config?x=4c9322cd4e3b7a16 dashboard link: https://syzkaller.appspot.com/bug?extid=7d6c5587ec9cff5be65c syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1433834ed00000 C reproducer: https://syzkaller.appspot.com/x/repro.c?x=149c71aad00000 The issue was bisected to: commit daaedb820ad716e00210af8859b194c404202b78 Author: Christoph Hellwig Date: Tue Nov 3 10:00:09 2020 +0000 mtd_blkdevs: don't override BLKFLSBUF bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=102c6ddcd00000 final oops: https://syzkaller.appspot.com/x/report.txt?x=122c6ddcd00000 console output: https://syzkaller.appspot.com/x/log.txt?x=142c6ddcd00000 IMPORTANT: if you fix the issue, please add the following tag to the commit: Reported-by: syzbot+7d6c5587ec9cff5be65c@syzkaller.appspotmail.com Fixes: daaedb820ad7 ("mtd_blkdevs: don't override BLKFLSBUF") ================================================================== BUG: KASAN: use-after-free in kobject_put+0x493/0x540 lib/kobject.c:749 Read of size 1 at addr ffff8880135d453c by task syz-executor372/8533 CPU: 0 PID: 8533 Comm: syz-executor372 Not tainted 5.12.0-rc4-next-20210326-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:79 [inline] dump_stack+0x141/0x1d7 lib/dump_stack.c:120 print_address_description.constprop.0.cold+0x5b/0x2f8 mm/kasan/report.c:232 __kasan_report mm/kasan/report.c:399 [inline] kasan_report.cold+0x7c/0xd8 mm/kasan/report.c:416 kobject_put+0x493/0x540 lib/kobject.c:749 delete_partition+0xa4/0x170 block/partitions/core.c:291 bdev_del_partition+0xf5/0x110 block/partitions/core.c:474 blkpg_do_ioctl+0x2e8/0x340 block/ioctl.c:33 blkpg_ioctl block/ioctl.c:60 [inline] blkdev_ioctl+0x577/0x6d0 block/ioctl.c:548 block_ioctl+0xf9/0x140 fs/block_dev.c:1667 vfs_ioctl fs/ioctl.c:48 [inline] __do_sys_ioctl fs/ioctl.c:753 [inline] __se_sys_ioctl fs/ioctl.c:739 [inline] __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:739 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x444329 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 b1 14 00 00 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 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffdd8945e58 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 0000000000487072 RCX: 0000000000444329 RDX: 0000000020000240 RSI: 0000000000001269 RDI: 0000000000000004 RBP: 0000000000000000 R08: 0023706f6f6c2f76 R09: 0000000000000001 R10: 000000000000001f R11: 0000000000000246 R12: 0000000000012734 R13: 00007ffdd8945e6c R14: 00007ffdd8945e80 R15: 00007ffdd8945e70 Allocated by task 8534: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:428 [inline] ____kasan_kmalloc mm/kasan/common.c:507 [inline] ____kasan_kmalloc mm/kasan/common.c:466 [inline] __kasan_kmalloc+0x9b/0xd0 mm/kasan/common.c:516 kmalloc include/linux/slab.h:556 [inline] kzalloc include/linux/slab.h:686 [inline] kobject_create lib/kobject.c:784 [inline] kobject_create_and_add+0x42/0xb0 lib/kobject.c:810 add_partition+0x56c/0x880 block/partitions/core.c:384 bdev_add_partition+0xb6/0x130 block/partitions/core.c:449 blkpg_do_ioctl+0x2d0/0x340 block/ioctl.c:43 blkpg_ioctl block/ioctl.c:60 [inline] blkdev_ioctl+0x577/0x6d0 block/ioctl.c:548 block_ioctl+0xf9/0x140 fs/block_dev.c:1667 vfs_ioctl fs/ioctl.c:48 [inline] __do_sys_ioctl fs/ioctl.c:753 [inline] __se_sys_ioctl fs/ioctl.c:739 [inline] __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:739 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xae Freed by task 8534: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_set_track+0x1c/0x30 mm/kasan/common.c:46 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:357 ____kasan_slab_free mm/kasan/common.c:360 [inline] ____kasan_slab_free mm/kasan/common.c:325 [inline] __kasan_slab_free+0xfb/0x130 mm/kasan/common.c:368 kasan_slab_free include/linux/kasan.h:212 [inline] slab_free_hook mm/slub.c:1578 [inline] slab_free_freelist_hook+0xdf/0x240 mm/slub.c:1603 slab_free mm/slub.c:3163 [inline] kfree+0xe5/0x7f0 mm/slub.c:4230 kobject_cleanup lib/kobject.c:705 [inline] kobject_release lib/kobject.c:736 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x1c8/0x540 lib/kobject.c:753 delete_partition+0xa4/0x170 block/partitions/core.c:291 bdev_del_partition+0xf5/0x110 block/partitions/core.c:474 blkpg_do_ioctl+0x2e8/0x340 block/ioctl.c:33 blkpg_ioctl block/ioctl.c:60 [inline] blkdev_ioctl+0x577/0x6d0 block/ioctl.c:548 block_ioctl+0xf9/0x140 fs/block_dev.c:1667 vfs_ioctl fs/ioctl.c:48 [inline] __do_sys_ioctl fs/ioctl.c:753 [inline] __se_sys_ioctl fs/ioctl.c:739 [inline] __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:739 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xae The buggy address belongs to the object at ffff8880135d4500 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 60 bytes inside of 64-byte region [ffff8880135d4500, ffff8880135d4540) The buggy address belongs to the page: page:ffffea00004d7500 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x135d4 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 0000000000000000 0000000100000001 ffff888010841640 raw: 0000000000000000 0000000000200020 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880135d4400: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff8880135d4480: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff8880135d4500: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff8880135d4580: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ffff8880135d4600: fa fb fb fb fb fb fb fb fc fc fc fc 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. For information about bisection process see: https://goo.gl/tpsmEJ#bisection syzbot can test patches for this issue, for details see: https://goo.gl/tpsmEJ#testing-patches