Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2116533lqz; Tue, 2 Apr 2024 07:41:49 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX2F6HrYr6C3Jg7Swlg+we1cIS7GFOkJxcTfhyxzBhT89LD5E+GyFyuk0OL5Okp/NGYmmb15uyg8FFzV7ZeIki7apqRb32JpSxi6rjQoA== X-Google-Smtp-Source: AGHT+IE5oST1P3hnydNxN3t+m/LoiWgTfJOkGs9oDyd+U3FfRS1hG8twxvbC8PaES7jFlFOhCdQo X-Received: by 2002:a05:6a21:1690:b0:1a6:fe1d:727f with SMTP id np16-20020a056a21169000b001a6fe1d727fmr14086601pzb.53.1712068909309; Tue, 02 Apr 2024 07:41:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712068909; cv=pass; d=google.com; s=arc-20160816; b=MOVA9m/eUGz7rYsT53eE6O8lnQTMH+UUjEaYeyDsgLjKSCT9SuD72LFTAU65lPk0Yr 8zxWMPTQO3vrLUyYpPg1RcLt57ZsBrgmEzVJavuN5uF7Fwf9I0pHO/FS1/5aK0BVCC42 EdaPqRpHK3ApUvgLukg4nf1FJckPHId4QvBW6/QjfkXwJzhVsL5+8XdFRojB4Hxw9Jj+ 8v2LbIzAg8UnHE/sD4kg4vpHTmSRtBoPZWoLskgnxpuBhQg/dsQsI9EJnZPVQQ4SLndX WDysGkn5jxwataGTsFj5Ga9mXodLU5zrbVkBtnAOU7nADAqrSY7xm+PYMK5NctNxTqCM HYhQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:from:subject:message-id:in-reply-to:date:mime-version :list-unsubscribe:list-subscribe:list-id:precedence; bh=m4BhvGm+79dtUpakYQBDCahsgl61NTLQEW72duDPoDg=; fh=2ImWyUPWCeYo+qeEyI//TXw4jGkarqoTZjogumU/uXM=; b=UZ48LBbj/qTkK14aB2WmsNqyryr6OWaomNdb6nj3PBqj7XSZUUNHQVBKem2NhkT2h+ 4HPMsOEAhn+8/iWwgJ2jZ74KGoTFjVJUrOYSRrFWwBCjLdpLFa+CRGw1NOuUNSSVTgIK oJZf+ynaRoIOxSEjxgJAE0tj7UwamOX3oYQk9+do0qFk+KZ3neYoHYZC7bHVjdsCAxc+ f9zUe/kX/C7UxysozukvzDsMNxHmvpxljUKOr9jXpD67zW/9fsIXNHuTsD/RNixb8Nv2 AR4j1YoLYSczRisuiKkX3xsJOol20w/BxYlHDHSwrozuqIoiB/x6xCn2Tmay+7hkMppN dOAw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=m3kw2wvrgufz5godrsrytgd7.apphosting.bounces.google.com); spf=pass (google.com: domain of linux-kernel+bounces-128165-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-128165-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=appspotmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id m22-20020a6562d6000000b005e3cdc24c26si11430124pgv.467.2024.04.02.07.41.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 07:41:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-128165-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=m3kw2wvrgufz5godrsrytgd7.apphosting.bounces.google.com); spf=pass (google.com: domain of linux-kernel+bounces-128165-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-128165-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=appspotmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 47C16286049 for ; Tue, 2 Apr 2024 14:41:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E8F7013540B; Tue, 2 Apr 2024 14:38:28 +0000 (UTC) Received: from mail-io1-f71.google.com (mail-io1-f71.google.com [209.85.166.71]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 334ED1353E2 for ; Tue, 2 Apr 2024 14:38:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.71 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712068707; cv=none; b=PDtQ9TAWzNITj48DLotcO32FkBOLEu1HnJY4PTAkBZJ0xv4aqGLw08w1ZwxTwI8KTkBAo5mzYzeGnNG40AvecPfEboO9WPNM6ONQGe1FIIeukr797Zb7FpIJ43+z44I4C/mhFbrLggjVoAbJdbGJPxKFlPaWDd12CndDkcfYpHA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712068707; c=relaxed/simple; bh=XPcXEYcJJ/WyBS2lsYIXXkraZhwxK8dNLIWkGZ7mmY0=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=XVV1Ti8//6NpCZvmhrqQWGRZdf5mnedpQtK92IErsX5XxZ2X/Ezmdl95zB1kYkON4v7qT4ZszRi66EcoQUquswfzP3eDL2xrTFgxvYRlPp7jN3PDG8hIXpp1EcoIh1jhhc00cNfLzkdD5EkmilCNB03lZW9Cs4QKyFHo1etrlvE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com; arc=none smtp.client-ip=209.85.166.71 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com Received: by mail-io1-f71.google.com with SMTP id ca18e2360f4ac-7cc0a422d43so584499339f.2 for ; Tue, 02 Apr 2024 07:38:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712068705; x=1712673505; h=to:from:subject:message-id:in-reply-to:date:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=m4BhvGm+79dtUpakYQBDCahsgl61NTLQEW72duDPoDg=; b=Zp+C1BgYdKggu93p8r71bIfaIVgkGF7c+XYGZ+MQyd4D5Q0LQvJry8k09Yv+Bpcju/ q3c9dKVz8PGHcihHENmrBfPI0059my0SXm7nkb6bhbGkX0RcnaiAPpD5g0EZGMhpy3mU TB/ksab8Y7XOOfkCCyDvFxhEDm6ckF+3bO/rA40c7clb4IokPNkqBjjUQazs6bDR3j6q aZYmZEhYw0abOxdOC+1u5judNFMft7gkAN9y9AgMoTbghZaIo0mxr4SujXCNjXC1fI9O 18OGZJFPGnYUs3xAq/rcYBHJxLDXguquK1WyBaH86zo2ttQ1eVVKSlJGKnoUS6xHFSpw GH6g== X-Forwarded-Encrypted: i=1; AJvYcCUihysJZQ8Mc2360uEKqMlDw+BKIFU99yrrcJD3uKt0/zxcHdbRDL6lyTtqSLzi+rHGPgPRk5xIU8Gl9EQkPJNp9nw08y293dh2SnsG X-Gm-Message-State: AOJu0YzyirzE06hOzg2pK+otY+UXBKHsEPU1tKSElMsW3c7j/5DUKWg4 +dQlkkX0vVv7Z6NKAZ/b8XOM5aHr2E8hbE3AVPsrphG/KkJEoOKNQLc6daFXvOXkxdCjTzbjUnT XAqqpQFUu/qnopqQ6G2499Fz/UMKK3CgudiWEw9TEvdOc3zHuB5YDkrQ= Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Received: by 2002:a05:6602:3fc4:b0:7c8:c7ec:2b71 with SMTP id fc4-20020a0566023fc400b007c8c7ec2b71mr172499iob.3.1712068705362; Tue, 02 Apr 2024 07:38:25 -0700 (PDT) Date: Tue, 02 Apr 2024 07:38:25 -0700 In-Reply-To: <000000000000fd0f2a061506cc93@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <00000000000003b8c406151e0fd1@google.com> Subject: Re: [syzbot] [nilfs?] KASAN: slab-out-of-bounds Read in wb_writeback From: syzbot To: brauner@kernel.org, gregkh@linuxfoundation.org, jack@suse.cz, konishi.ryusuke@gmail.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nilfs@vger.kernel.org, syzkaller-bugs@googlegroups.com, tj@kernel.org, viro@zeniv.linux.org.uk Content-Type: text/plain; charset="UTF-8" syzbot has found a reproducer for the following issue on: HEAD commit: c0b832517f62 Add linux-next specific files for 20240402 git tree: linux-next console+strace: https://syzkaller.appspot.com/x/log.txt?x=14af7dd9180000 kernel config: https://syzkaller.appspot.com/x/.config?x=afcaf46d374cec8c dashboard link: https://syzkaller.appspot.com/bug?extid=7b219b86935220db6dd8 compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40 syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1729f003180000 C reproducer: https://syzkaller.appspot.com/x/repro.c?x=17fa4341180000 Downloadable assets: disk image: https://storage.googleapis.com/syzbot-assets/0d36ec76edc7/disk-c0b83251.raw.xz vmlinux: https://storage.googleapis.com/syzbot-assets/6f9bb4e37dd0/vmlinux-c0b83251.xz kernel image: https://storage.googleapis.com/syzbot-assets/2349287b14b7/bzImage-c0b83251.xz mounted in repro: https://storage.googleapis.com/syzbot-assets/9760c52a227c/mount_0.gz IMPORTANT: if you fix the issue, please add the following tag to the commit: Reported-by: syzbot+7b219b86935220db6dd8@syzkaller.appspotmail.com ================================================================== BUG: KASAN: slab-out-of-bounds in __lock_acquire+0x78/0x1fd0 kernel/locking/lockdep.c:5005 Read of size 8 at addr ffff888020485fa8 by task kworker/u8:2/35 CPU: 0 PID: 35 Comm: kworker/u8:2 Not tainted 6.9.0-rc2-next-20240402-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 Workqueue: writeback wb_workfn (flush-7:1) Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114 print_address_description mm/kasan/report.c:377 [inline] print_report+0x169/0x550 mm/kasan/report.c:488 kasan_report+0x143/0x180 mm/kasan/report.c:601 __lock_acquire+0x78/0x1fd0 kernel/locking/lockdep.c:5005 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754 __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline] _raw_spin_lock+0x2e/0x40 kernel/locking/spinlock.c:154 spin_lock include/linux/spinlock.h:351 [inline] wb_writeback+0x66f/0xd30 fs/fs-writeback.c:2160 wb_check_old_data_flush fs/fs-writeback.c:2233 [inline] wb_do_writeback fs/fs-writeback.c:2286 [inline] wb_workfn+0xba1/0x1090 fs/fs-writeback.c:2314 process_one_work kernel/workqueue.c:3218 [inline] process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3299 worker_thread+0x86d/0xd70 kernel/workqueue.c:3380 kthread+0x2f0/0x390 kernel/kthread.c:388 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:243 Allocated by task 5052: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:370 [inline] __kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:387 kasan_kmalloc include/linux/kasan.h:211 [inline] __do_kmalloc_node mm/slub.c:4048 [inline] __kmalloc_noprof+0x200/0x410 mm/slub.c:4061 kmalloc_noprof include/linux/slab.h:664 [inline] tomoyo_realpath_from_path+0xcf/0x5e0 security/tomoyo/realpath.c:251 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_perm+0x2b7/0x740 security/tomoyo/file.c:822 security_inode_getattr+0xd8/0x130 security/security.c:2269 vfs_getattr+0x45/0x430 fs/stat.c:173 vfs_fstat fs/stat.c:198 [inline] vfs_fstatat+0xd6/0x190 fs/stat.c:300 __do_sys_newfstatat fs/stat.c:468 [inline] __se_sys_newfstatat fs/stat.c:462 [inline] __x64_sys_newfstatat+0x125/0x1b0 fs/stat.c:462 do_syscall_64+0xfb/0x240 entry_SYSCALL_64_after_hwframe+0x72/0x7a Freed by task 5052: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 kasan_save_free_info+0x40/0x50 mm/kasan/generic.c:579 poison_slab_object+0xe0/0x150 mm/kasan/common.c:240 __kasan_slab_free+0x37/0x60 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2180 [inline] slab_free mm/slub.c:4363 [inline] kfree+0x149/0x350 mm/slub.c:4484 tomoyo_realpath_from_path+0x5a9/0x5e0 security/tomoyo/realpath.c:286 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_perm+0x2b7/0x740 security/tomoyo/file.c:822 security_inode_getattr+0xd8/0x130 security/security.c:2269 vfs_getattr+0x45/0x430 fs/stat.c:173 vfs_fstat fs/stat.c:198 [inline] vfs_fstatat+0xd6/0x190 fs/stat.c:300 __do_sys_newfstatat fs/stat.c:468 [inline] __se_sys_newfstatat fs/stat.c:462 [inline] __x64_sys_newfstatat+0x125/0x1b0 fs/stat.c:462 do_syscall_64+0xfb/0x240 entry_SYSCALL_64_after_hwframe+0x72/0x7a The buggy address belongs to the object at ffff888020484000 which belongs to the cache kmalloc-4k of size 4096 The buggy address is located 4008 bytes to the right of allocated 4096-byte region [ffff888020484000, ffff888020485000) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x20480 head: order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff80000000040(head|node=0|zone=1|lastcpupid=0xfff) page_type: 0xffffefff(slab) raw: 00fff80000000040 ffff888015042140 dead000000000100 dead000000000122 raw: 0000000000000000 0000000000040004 00000001ffffefff 0000000000000000 head: 00fff80000000040 ffff888015042140 dead000000000100 dead000000000122 head: 0000000000000000 0000000000040004 00000001ffffefff 0000000000000000 head: 00fff80000000003 ffffea0000812001 ffffea0000812048 00000000ffffffff head: 0000000800000000 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 1, tgid -957297381 (swapper/0), ts 1, free_ts 0 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1490 prep_new_page mm/page_alloc.c:1498 [inline] get_page_from_freelist+0x2e7e/0x2f40 mm/page_alloc.c:3454 __alloc_pages_noprof+0x256/0x6c0 mm/page_alloc.c:4712 __alloc_pages_node_noprof include/linux/gfp.h:244 [inline] alloc_pages_node_noprof include/linux/gfp.h:271 [inline] alloc_slab_page+0x5f/0x120 mm/slub.c:2249 allocate_slab+0x5a/0x2e0 mm/slub.c:2412 new_slab mm/slub.c:2465 [inline] ___slab_alloc+0xea8/0x1430 mm/slub.c:3599 __slab_alloc+0x58/0xa0 mm/slub.c:3684 __slab_alloc_node mm/slub.c:3737 [inline] slab_alloc_node mm/slub.c:3915 [inline] kmalloc_node_trace_noprof+0x20c/0x300 mm/slub.c:4087 kmalloc_node_noprof include/linux/slab.h:677 [inline] bdi_alloc+0x4f/0x140 mm/backing-dev.c:894 __alloc_disk_node+0xb8/0x590 block/genhd.c:1347 __blk_mq_alloc_disk+0x17d/0x260 block/blk-mq.c:4166 loop_add+0x448/0xba0 drivers/block/loop.c:2032 loop_init+0x17a/0x230 drivers/block/loop.c:2275 do_one_initcall+0x248/0x880 init/main.c:1258 do_initcall_level+0x157/0x210 init/main.c:1320 do_initcalls+0x3f/0x80 init/main.c:1336 page_owner free stack trace missing Memory state around the buggy address: ffff888020485e80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888020485f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888020485f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff888020486000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888020486080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== --- 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.