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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9F66BC83F01 for ; Wed, 30 Aug 2023 21:26:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241177AbjH3V0D (ORCPT ); Wed, 30 Aug 2023 17:26:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230381AbjH3V0B (ORCPT ); Wed, 30 Aug 2023 17:26:01 -0400 Received: from mail-ot1-f80.google.com (mail-ot1-f80.google.com [209.85.210.80]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 23B2FCF for ; Wed, 30 Aug 2023 14:25:23 -0700 (PDT) Received: by mail-ot1-f80.google.com with SMTP id 46e09a7af769-6b9d8b76be5so349416a34.1 for ; Wed, 30 Aug 2023 14:25:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693430629; x=1694035429; h=to:from:subject:message-id:date:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=LF5X2dX5JgaEV6smkE+eHIcyD8otOWlV/ygSISQwjoY=; b=eQ/QWeM9f8S/3KMivfTRU/xZiKIVXFvsdU6HgEzu1m1CbA4vmqwZ6kTsOQmOy0ZrOe uAYyWupFlpUAlzJzjjntQGooWiYaBt1/cxDOVq87kIFuaWI2wleNb+qZQ23hilLsR5zl 3NVMUxxuvW0taZNxRiR9MAsTXZl5qpDF5IPYb8eqKf02ljRFdnenDkWPqRS+j0v+GchG ElYx3MYfzxOfYPSHOivIasQv22oKy98QNIU1dVp+i3om41pMbJpbef5p0q6w5owC9kI0 LUWPUZTdkrIe6eQHs9stUGcDKXvt0d/o6ijLRuRBPxt/kR/PNB+rnJE9D3mQIVOXlqN9 6QFA== X-Gm-Message-State: AOJu0YzhD2ds/494tw8hi0QMOjzUV7n3tfkhS86Xsh8G/zba3Pojc/wh Evfwp9HRupafURkMernHyk+iv03VBGFkd4PM9fatDDnZ1O9D X-Google-Smtp-Source: AGHT+IHvQ0X1H7mClp53/EehJZsA4DiISYPN4bk29tIO2frPxeAGe6JGQLg/o3zjIXVilR0UzbzyNjLCk8MwGMBHpu2bjiZ0wfZb MIME-Version: 1.0 X-Received: by 2002:a05:6830:43:b0:6bd:178f:ef85 with SMTP id d3-20020a056830004300b006bd178fef85mr283351otp.7.1693430629267; Wed, 30 Aug 2023 14:23:49 -0700 (PDT) Date: Wed, 30 Aug 2023 14:23:49 -0700 X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <0000000000001bfca206042a8bbc@google.com> Subject: [syzbot] [kernel?] KASAN: slab-use-after-free Read in pwq_release_workfn From: syzbot To: bp@alien8.de, brauner@kernel.org, dave.hansen@linux.intel.com, hpa@zytor.com, linux-kernel@vger.kernel.org, mingo@redhat.com, syzkaller-bugs@googlegroups.com, tglx@linutronix.de, x86@kernel.org 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: 626932085009 Add linux-next specific files for 20230825 git tree: linux-next console+strace: https://syzkaller.appspot.com/x/log.txt?x=12268740680000 kernel config: https://syzkaller.appspot.com/x/.config?x=8a8c992a790e5073 dashboard link: https://syzkaller.appspot.com/bug?extid=60db9f652c92d5bacba4 compiler: gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40 syz repro: https://syzkaller.appspot.com/x/repro.syz?x=15e25db7a80000 C reproducer: https://syzkaller.appspot.com/x/repro.c?x=15b154c0680000 Downloadable assets: disk image: https://storage.googleapis.com/syzbot-assets/46ec18b3c2fb/disk-62693208.raw.xz vmlinux: https://storage.googleapis.com/syzbot-assets/b4ea0cb78498/vmlinux-62693208.xz kernel image: https://storage.googleapis.com/syzbot-assets/5fb3938c7272/bzImage-62693208.xz IMPORTANT: if you fix the issue, please add the following tag to the commit: Reported-by: syzbot+60db9f652c92d5bacba4@syzkaller.appspotmail.com ================================================================== BUG: KASAN: slab-use-after-free in pwq_release_workfn+0x339/0x380 kernel/workqueue.c:4124 Read of size 4 at addr ffff888027b831c0 by task pool_workqueue_/3 CPU: 0 PID: 3 Comm: pool_workqueue_ Not tainted 6.5.0-rc7-next-20230825-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/26/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0xc4/0x620 mm/kasan/report.c:475 kasan_report+0xda/0x110 mm/kasan/report.c:588 pwq_release_workfn+0x339/0x380 kernel/workqueue.c:4124 kthread_worker_fn+0x2fc/0xa80 kernel/kthread.c:823 kthread+0x33a/0x430 kernel/kthread.c:388 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 Allocated by task 5054: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0xa2/0xb0 mm/kasan/common.c:383 kmalloc include/linux/slab.h:599 [inline] kzalloc include/linux/slab.h:720 [inline] alloc_workqueue+0x16f/0x1490 kernel/workqueue.c:4684 kvm_mmu_init_tdp_mmu+0x23/0x100 arch/x86/kvm/mmu/tdp_mmu.c:19 kvm_mmu_init_vm+0x248/0x2e0 arch/x86/kvm/mmu/mmu.c:6180 kvm_arch_init_vm+0x39/0x720 arch/x86/kvm/x86.c:12311 kvm_create_vm arch/x86/kvm/../../../virt/kvm/kvm_main.c:1222 [inline] kvm_dev_ioctl_create_vm arch/x86/kvm/../../../virt/kvm/kvm_main.c:5089 [inline] kvm_dev_ioctl+0xa31/0x1c20 arch/x86/kvm/../../../virt/kvm/kvm_main.c:5131 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:871 [inline] __se_sys_ioctl fs/ioctl.c:857 [inline] __x64_sys_ioctl+0x18f/0x210 fs/ioctl.c:857 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Freed by task 5054: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:522 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free+0x15b/0x1b0 mm/kasan/common.c:200 kasan_slab_free include/linux/kasan.h:164 [inline] slab_free_hook mm/slub.c:1800 [inline] slab_free_freelist_hook+0x114/0x1e0 mm/slub.c:1826 slab_free mm/slub.c:3809 [inline] __kmem_cache_free+0xb8/0x2f0 mm/slub.c:3822 alloc_workqueue+0xe76/0x1490 kernel/workqueue.c:4746 kvm_mmu_init_tdp_mmu+0x23/0x100 arch/x86/kvm/mmu/tdp_mmu.c:19 kvm_mmu_init_vm+0x248/0x2e0 arch/x86/kvm/mmu/mmu.c:6180 kvm_arch_init_vm+0x39/0x720 arch/x86/kvm/x86.c:12311 kvm_create_vm arch/x86/kvm/../../../virt/kvm/kvm_main.c:1222 [inline] kvm_dev_ioctl_create_vm arch/x86/kvm/../../../virt/kvm/kvm_main.c:5089 [inline] kvm_dev_ioctl+0xa31/0x1c20 arch/x86/kvm/../../../virt/kvm/kvm_main.c:5131 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:871 [inline] __se_sys_ioctl fs/ioctl.c:857 [inline] __x64_sys_ioctl+0x18f/0x210 fs/ioctl.c:857 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd The buggy address belongs to the object at ffff888027b83000 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 448 bytes inside of freed 512-byte region [ffff888027b83000, ffff888027b83200) The buggy address belongs to the physical page: page:ffffea00009ee000 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x27b80 head:ffffea00009ee000 order:2 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000840 ffff888012c41c80 ffffea000084fd00 dead000000000002 raw: 0000000000000000 0000000080100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 2, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 3260, tgid 3260 (kworker/u4:1), ts 17219877730, free_ts 0 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2cf/0x340 mm/page_alloc.c:1530 prep_new_page mm/page_alloc.c:1537 [inline] get_page_from_freelist+0xf17/0x2e50 mm/page_alloc.c:3200 __alloc_pages+0x1d0/0x4a0 mm/page_alloc.c:4456 alloc_pages+0x1a9/0x270 mm/mempolicy.c:2298 alloc_slab_page mm/slub.c:1870 [inline] allocate_slab+0x251/0x380 mm/slub.c:2017 new_slab mm/slub.c:2070 [inline] ___slab_alloc+0x8be/0x1570 mm/slub.c:3223 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3322 __slab_alloc_node mm/slub.c:3375 [inline] slab_alloc_node mm/slub.c:3468 [inline] __kmem_cache_alloc_node+0x137/0x350 mm/slub.c:3517 kmalloc_trace+0x25/0xe0 mm/slab_common.c:1114 kmalloc include/linux/slab.h:599 [inline] kzalloc include/linux/slab.h:720 [inline] alloc_bprm+0x51/0xaf0 fs/exec.c:1514 kernel_execve+0xaf/0x4e0 fs/exec.c:1989 call_usermodehelper_exec_async+0x256/0x4c0 kernel/umh.c:110 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 page_owner free stack trace missing Memory state around the buggy address: ffff888027b83080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888027b83100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888027b83180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888027b83200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888027b83280: fc fc fc fc fc fc fc fc 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. If the bug is already fixed, let syzbot know by replying with: #syz fix: exact-commit-title If you want syzbot to run the reproducer, reply with: #syz test: git://repo/address.git branch-or-commit-hash If you attach or paste a git patch, syzbot will apply it before testing. If you want to overwrite bug's subsystems, reply with: #syz set subsystems: new-subsystem (See the list of subsystem names on the web dashboard) If the bug is a duplicate of another bug, reply with: #syz dup: exact-subject-of-another-report If you want to undo deduplication, reply with: #syz undup