public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [syzbot] [jfs?] KASAN: use-after-free Read in release_metapage
@ 2023-01-02 10:00 syzbot
  2023-05-19  4:17 ` syzbot
  2024-08-03 19:28 ` syzbot
  0 siblings, 2 replies; 3+ messages in thread
From: syzbot @ 2023-01-02 10:00 UTC (permalink / raw)
  To: axboe, damien.lemoal, jfs-discussion, jlayton, kch, linux-kernel,
	shaggy, syzkaller-bugs, willy

Hello,

syzbot found the following issue on:

HEAD commit:    2f26e424552e Merge tag 'loongarch-6.2' of git://git.kernel..
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=17152890480000
kernel config:  https://syzkaller.appspot.com/x/.config?x=e4653f4fa0089644
dashboard link: https://syzkaller.appspot.com/bug?extid=f1521383cec5f7baaa94
compiler:       gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2

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+f1521383cec5f7baaa94@syzkaller.appspotmail.com

==================================================================
BUG: KASAN: use-after-free in drop_metapage fs/jfs/jfs_metapage.c:223 [inline]
BUG: KASAN: use-after-free in release_metapage+0xe08/0xf00 fs/jfs/jfs_metapage.c:757
Read of size 8 at addr ffff888000d80310 by task syz-executor.1/5579

CPU: 3 PID: 5579 Comm: syz-executor.1 Not tainted 6.1.0-syzkaller-13409-g2f26e424552e #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xd1/0x138 lib/dump_stack.c:106
 print_address_description mm/kasan/report.c:306 [inline]
 print_report+0x15e/0x461 mm/kasan/report.c:417
 kasan_report+0xbf/0x1f0 mm/kasan/report.c:517
 drop_metapage fs/jfs/jfs_metapage.c:223 [inline]
 release_metapage+0xe08/0xf00 fs/jfs/jfs_metapage.c:757
 write_metapage fs/jfs/jfs_metapage.h:75 [inline]
 flush_metapage fs/jfs/jfs_metapage.h:81 [inline]
 ea_write+0x5d6/0xc90 fs/jfs/xattr.c:280
 ea_put fs/jfs/xattr.c:610 [inline]
 __jfs_setxattr+0xead/0xfc0 fs/jfs/xattr.c:783
 __jfs_xattr_set+0xc9/0x150 fs/jfs/xattr.c:917
 __vfs_setxattr+0x173/0x1e0 fs/xattr.c:202
 __vfs_setxattr_noperm+0x129/0x5f0 fs/xattr.c:236
 __vfs_setxattr_locked+0x1d3/0x260 fs/xattr.c:297
 vfs_setxattr+0x143/0x340 fs/xattr.c:323
 do_setxattr+0x151/0x190 fs/xattr.c:608
 setxattr+0x146/0x160 fs/xattr.c:631
 path_setxattr+0x197/0x1c0 fs/xattr.c:650
 __do_sys_setxattr fs/xattr.c:666 [inline]
 __se_sys_setxattr fs/xattr.c:662 [inline]
 __x64_sys_setxattr+0xc4/0x160 fs/xattr.c:662
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7fb50cc8c0d9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fb50d94f168 EFLAGS: 00000246 ORIG_RAX: 00000000000000bc
RAX: ffffffffffffffda RBX: 00007fb50cdabf80 RCX: 00007fb50cc8c0d9
RDX: 0000000020000200 RSI: 00000000200000c0 RDI: 0000000020000080
RBP: 00007fb50cce7ae9 R08: 0000000000000000 R09: 0000000000000000
R10: 000000000000c001 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffcf4c5f19f R14: 00007fb50d94f300 R15: 0000000000022000
 </TASK>

Allocated by task 5579:
 kasan_save_stack+0x22/0x40 mm/kasan/common.c:45
 kasan_set_track+0x25/0x30 mm/kasan/common.c:52
 __kasan_slab_alloc+0x7f/0x90 mm/kasan/common.c:325
 kasan_slab_alloc include/linux/kasan.h:201 [inline]
 slab_post_alloc_hook mm/slab.h:761 [inline]
 slab_alloc_node mm/slab.c:3261 [inline]
 slab_alloc mm/slab.c:3270 [inline]
 __kmem_cache_alloc_lru mm/slab.c:3447 [inline]
 kmem_cache_alloc+0x225/0x460 mm/slab.c:3456
 mempool_alloc+0x158/0x360 mm/mempool.c:398
 alloc_metapage fs/jfs/jfs_metapage.c:176 [inline]
 __get_metapage+0x73d/0xf00 fs/jfs/jfs_metapage.c:651
 ea_write+0x6d7/0xc90 fs/jfs/xattr.c:256
 ea_put fs/jfs/xattr.c:610 [inline]
 __jfs_setxattr+0xead/0xfc0 fs/jfs/xattr.c:783
 __jfs_xattr_set+0xc9/0x150 fs/jfs/xattr.c:917
 __vfs_setxattr+0x173/0x1e0 fs/xattr.c:202
 __vfs_setxattr_noperm+0x129/0x5f0 fs/xattr.c:236
 __vfs_setxattr_locked+0x1d3/0x260 fs/xattr.c:297
 vfs_setxattr+0x143/0x340 fs/xattr.c:323
 do_setxattr+0x151/0x190 fs/xattr.c:608
 setxattr+0x146/0x160 fs/xattr.c:631
 path_setxattr+0x197/0x1c0 fs/xattr.c:650
 __do_sys_setxattr fs/xattr.c:666 [inline]
 __se_sys_setxattr fs/xattr.c:662 [inline]
 __x64_sys_setxattr+0xc4/0x160 fs/xattr.c:662
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

Freed by task 5583:
 kasan_save_stack+0x22/0x40 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:518
 ____kasan_slab_free mm/kasan/common.c:236 [inline]
 ____kasan_slab_free+0x13b/0x1a0 mm/kasan/common.c:200
 kasan_slab_free include/linux/kasan.h:177 [inline]
 __cache_free mm/slab.c:3394 [inline]
 __do_kmem_cache_free mm/slab.c:3580 [inline]
 kmem_cache_free mm/slab.c:3605 [inline]
 kmem_cache_free+0x108/0x4c0 mm/slab.c:3598
 mempool_free+0xe7/0x3b0 mm/mempool.c:507
 free_metapage fs/jfs/jfs_metapage.c:191 [inline]
 metapage_release_folio+0x2b5/0x3c0 fs/jfs/jfs_metapage.c:551
 filemap_release_folio+0x13f/0x1b0 mm/filemap.c:3967
 shrink_folio_list+0x1ea9/0x3a60 mm/vmscan.c:2000
 shrink_inactive_list mm/vmscan.c:2526 [inline]
 shrink_list mm/vmscan.c:2767 [inline]
 shrink_lruvec+0xd0e/0x27a0 mm/vmscan.c:5951
 shrink_node_memcgs mm/vmscan.c:6138 [inline]
 shrink_node+0x8f2/0x1f40 mm/vmscan.c:6169
 shrink_zones mm/vmscan.c:6407 [inline]
 do_try_to_free_pages+0x3b4/0x17a0 mm/vmscan.c:6469
 try_to_free_pages+0x2e5/0x960 mm/vmscan.c:6704
 __perform_reclaim mm/page_alloc.c:4750 [inline]
 __alloc_pages_direct_reclaim mm/page_alloc.c:4772 [inline]
 __alloc_pages_slowpath.constprop.0+0x8b6/0x23d0 mm/page_alloc.c:5178
 __alloc_pages+0x4aa/0x5b0 mm/page_alloc.c:5562
 alloc_pages+0x1aa/0x270 mm/mempolicy.c:2285
 folio_alloc+0x20/0x70 mm/mempolicy.c:2295
 filemap_alloc_folio+0x362/0x450 mm/filemap.c:972
 __filemap_get_folio+0x32c/0xd80 mm/filemap.c:1966
 pagecache_get_page+0x2e/0x280 mm/folio-compat.c:98
 find_or_create_page include/linux/pagemap.h:612 [inline]
 grow_dev_page fs/buffer.c:946 [inline]
 grow_buffers fs/buffer.c:1011 [inline]
 __getblk_slow+0x1f4/0x1030 fs/buffer.c:1038
 __getblk_gfp+0x72/0x80 fs/buffer.c:1333
 sb_getblk include/linux/buffer_head.h:356 [inline]
 search_by_key+0x3ac/0x3bf0 fs/reiserfs/stree.c:672
 reiserfs_read_locked_inode+0x158/0x2160 fs/reiserfs/inode.c:1549
 reiserfs_fill_super+0x1273/0x2e90 fs/reiserfs/super.c:2071
 mount_bdev+0x351/0x410 fs/super.c:1359
 legacy_get_tree+0x109/0x220 fs/fs_context.c:610
 vfs_get_tree+0x8d/0x2f0 fs/super.c:1489
 do_new_mount fs/namespace.c:3145 [inline]
 path_mount+0x132a/0x1e20 fs/namespace.c:3475
 do_mount fs/namespace.c:3488 [inline]
 __do_sys_mount fs/namespace.c:3697 [inline]
 __se_sys_mount fs/namespace.c:3674 [inline]
 __x64_sys_mount+0x283/0x300 fs/namespace.c:3674
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

The buggy address belongs to the object at ffff888000d802e8
 which belongs to the cache jfs_mp of size 184
The buggy address is located 40 bytes inside of
 184-byte region [ffff888000d802e8, ffff888000d803a0)

The buggy address belongs to the physical page:
page:ffffea0000036000 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0xd80
flags: 0x7ff00000000200(slab|node=0|zone=0|lastcpupid=0x7ff)
raw: 007ff00000000200 ffff888043795600 ffffea000057a090 ffffea00006b5d90
raw: 0000000000000000 ffff888000d80000 0000000100000010 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 0x2d2000(__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_THISNODE), pid 5532, tgid 5531 (syz-executor.2), ts 318971103348, free_ts 315871259807
 prep_new_page mm/page_alloc.c:2531 [inline]
 get_page_from_freelist+0x119c/0x2ce0 mm/page_alloc.c:4283
 __alloc_pages_slowpath.constprop.0+0x36b/0x23d0 mm/page_alloc.c:5084
 __alloc_pages+0x4aa/0x5b0 mm/page_alloc.c:5562
 __alloc_pages_node include/linux/gfp.h:237 [inline]
 kmem_getpages mm/slab.c:1363 [inline]
 cache_grow_begin+0x94/0x390 mm/slab.c:2574
 cache_alloc_refill+0x27f/0x380 mm/slab.c:2947
 ____cache_alloc mm/slab.c:3023 [inline]
 ____cache_alloc mm/slab.c:3006 [inline]
 __do_cache_alloc mm/slab.c:3206 [inline]
 slab_alloc_node mm/slab.c:3254 [inline]
 slab_alloc mm/slab.c:3270 [inline]
 __kmem_cache_alloc_lru mm/slab.c:3447 [inline]
 kmem_cache_alloc+0x366/0x460 mm/slab.c:3456
 mempool_alloc+0x158/0x360 mm/mempool.c:398
 alloc_metapage fs/jfs/jfs_metapage.c:176 [inline]
 __get_metapage+0x73d/0xf00 fs/jfs/jfs_metapage.c:651
 diReadSpecial+0x191/0x6d0 fs/jfs/jfs_imap.c:443
 jfs_mount+0xd1/0x7b0 fs/jfs/jfs_mount.c:87
 jfs_fill_super+0x5a8/0xc80 fs/jfs/super.c:556
 mount_bdev+0x351/0x410 fs/super.c:1359
 legacy_get_tree+0x109/0x220 fs/fs_context.c:610
 vfs_get_tree+0x8d/0x2f0 fs/super.c:1489
 do_new_mount fs/namespace.c:3145 [inline]
 path_mount+0x132a/0x1e20 fs/namespace.c:3475
 do_mount fs/namespace.c:3488 [inline]
 __do_sys_mount fs/namespace.c:3697 [inline]
 __se_sys_mount fs/namespace.c:3674 [inline]
 __x64_sys_mount+0x283/0x300 fs/namespace.c:3674
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:24 [inline]
 free_pages_prepare mm/page_alloc.c:1446 [inline]
 free_pcp_prepare+0x65c/0xc00 mm/page_alloc.c:1496
 free_unref_page_prepare mm/page_alloc.c:3369 [inline]
 free_unref_page+0x1d/0x490 mm/page_alloc.c:3464
 __vunmap+0x85d/0xd30 mm/vmalloc.c:2727
 free_work+0x5c/0x80 mm/vmalloc.c:100
 process_one_work+0x9bf/0x1710 kernel/workqueue.c:2289
 worker_thread+0x669/0x1090 kernel/workqueue.c:2436
 kthread+0x2e8/0x3a0 kernel/kthread.c:376
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308

Memory state around the buggy address:
 ffff888000d80200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888000d80280: fb fb fb fb fb fc fc fc fc fc fc fc fc fa fb fb
>ffff888000d80300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                         ^
 ffff888000d80380: fb fb fb fb fc fc fc fc fc fc fc fc fb fb fb fb
 ffff888000d80400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================


---
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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [syzbot] [jfs?] KASAN: use-after-free Read in release_metapage
  2023-01-02 10:00 [syzbot] [jfs?] KASAN: use-after-free Read in release_metapage syzbot
@ 2023-05-19  4:17 ` syzbot
  2024-08-03 19:28 ` syzbot
  1 sibling, 0 replies; 3+ messages in thread
From: syzbot @ 2023-05-19  4:17 UTC (permalink / raw)
  To: axboe, damien.lemoal, jfs-discussion, jlayton, kch, linux-fsdevel,
	linux-kernel, shaggy, syzkaller-bugs, willy

syzbot has found a reproducer for the following issue on:

HEAD commit:    4d6d4c7f541d Merge tag 'linux-kselftest-fixes-6.4-rc3' of ..
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=166d0691280000
kernel config:  https://syzkaller.appspot.com/x/.config?x=94af80bb8ddd23c4
dashboard link: https://syzkaller.appspot.com/bug?extid=f1521383cec5f7baaa94
compiler:       Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=13385bd6280000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=11c11186280000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/ded3ca087ccf/disk-4d6d4c7f.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/75c4212eadbe/vmlinux-4d6d4c7f.xz
kernel image: https://storage.googleapis.com/syzbot-assets/9ffc937ead4f/bzImage-4d6d4c7f.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/8ae1719fba02/mount_0.gz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+f1521383cec5f7baaa94@syzkaller.appspotmail.com

==================================================================
BUG: KASAN: slab-use-after-free in drop_metapage fs/jfs/jfs_metapage.c:223 [inline]
BUG: KASAN: slab-use-after-free in release_metapage+0x5a7/0x870 fs/jfs/jfs_metapage.c:786
Read of size 8 at addr ffff888029b76218 by task syz-executor361/5082

CPU: 1 PID: 5082 Comm: syz-executor361 Not tainted 6.4.0-rc2-syzkaller-00018-g4d6d4c7f541d #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/28/2023
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106
 print_address_description mm/kasan/report.c:351 [inline]
 print_report+0x163/0x540 mm/kasan/report.c:462
 kasan_report+0x176/0x1b0 mm/kasan/report.c:572
 drop_metapage fs/jfs/jfs_metapage.c:223 [inline]
 release_metapage+0x5a7/0x870 fs/jfs/jfs_metapage.c:786
 write_metapage fs/jfs/jfs_metapage.h:75 [inline]
 flush_metapage fs/jfs/jfs_metapage.h:81 [inline]
 ea_put fs/jfs/xattr.c:614 [inline]
 __jfs_setxattr+0xad9/0x11d0 fs/jfs/xattr.c:783
 jfs_initxattrs+0x128/0x1d0 fs/jfs/xattr.c:1016
 security_inode_init_security+0x2df/0x3f0 security/security.c:1630
 jfs_init_security+0xa9/0x110 fs/jfs/xattr.c:1028
 jfs_mkdir+0x2c7/0xbb0 fs/jfs/namei.c:240
 vfs_mkdir+0x29d/0x450 fs/namei.c:4115
 do_mkdirat+0x264/0x520 fs/namei.c:4138
 __do_sys_mkdir fs/namei.c:4158 [inline]
 __se_sys_mkdir fs/namei.c:4156 [inline]
 __x64_sys_mkdir+0x6e/0x80 fs/namei.c:4156
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7fce4779cec9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 b1 15 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fce40327318 EFLAGS: 00000246 ORIG_RAX: 0000000000000053
RAX: ffffffffffffffda RBX: 00007fce478287b8 RCX: 00007fce4779cec9
RDX: 00007fce40327700 RSI: 0000000000000000 RDI: 0000000020000040
RBP: 00007fce478287b0 R08: 00007fce40327700 R09: 0000000000000000
R10: 00007fce40327700 R11: 0000000000000246 R12: 0030656c69662f2e
R13: 00007ffcc2233f3f R14: 00007fce40327400 R15: 0000000000022000
 </TASK>

Allocated by task 5082:
 kasan_save_stack mm/kasan/common.c:45 [inline]
 kasan_set_track+0x4f/0x70 mm/kasan/common.c:52
 __kasan_slab_alloc+0x66/0x70 mm/kasan/common.c:328
 kasan_slab_alloc include/linux/kasan.h:186 [inline]
 slab_post_alloc_hook+0x68/0x3a0 mm/slab.h:711
 slab_alloc_node mm/slub.c:3451 [inline]
 slab_alloc mm/slub.c:3459 [inline]
 __kmem_cache_alloc_lru mm/slub.c:3466 [inline]
 kmem_cache_alloc+0x11f/0x2e0 mm/slub.c:3475
 mempool_alloc+0x194/0x580 mm/mempool.c:398
 alloc_metapage fs/jfs/jfs_metapage.c:176 [inline]
 __get_metapage+0x574/0x10e0 fs/jfs/jfs_metapage.c:651
 ea_get+0xb3f/0x1280 fs/jfs/xattr.c:526
 __jfs_setxattr+0x4ba/0x11d0 fs/jfs/xattr.c:718
 jfs_initxattrs+0x128/0x1d0 fs/jfs/xattr.c:1016
 security_inode_init_security+0x2df/0x3f0 security/security.c:1630
 jfs_init_security+0xa9/0x110 fs/jfs/xattr.c:1028
 jfs_mkdir+0x2c7/0xbb0 fs/jfs/namei.c:240
 vfs_mkdir+0x29d/0x450 fs/namei.c:4115
 do_mkdirat+0x264/0x520 fs/namei.c:4138
 __do_sys_mkdir fs/namei.c:4158 [inline]
 __se_sys_mkdir fs/namei.c:4156 [inline]
 __x64_sys_mkdir+0x6e/0x80 fs/namei.c:4156
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

Freed by task 5074:
 kasan_save_stack mm/kasan/common.c:45 [inline]
 kasan_set_track+0x4f/0x70 mm/kasan/common.c:52
 kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:521
 ____kasan_slab_free+0xd6/0x120 mm/kasan/common.c:236
 kasan_slab_free include/linux/kasan.h:162 [inline]
 slab_free_hook mm/slub.c:1781 [inline]
 slab_free_freelist_hook mm/slub.c:1807 [inline]
 slab_free mm/slub.c:3786 [inline]
 kmem_cache_free+0x297/0x520 mm/slub.c:3808
 free_metapage fs/jfs/jfs_metapage.c:191 [inline]
 metapage_release_folio+0x5cc/0x730 fs/jfs/jfs_metapage.c:551
 shrink_folio_list+0x26f1/0x8940 mm/vmscan.c:2076
 shrink_inactive_list mm/vmscan.c:2602 [inline]
 shrink_list mm/vmscan.c:2843 [inline]
 shrink_lruvec+0x16e6/0x2d30 mm/vmscan.c:6279
 shrink_node_memcgs mm/vmscan.c:6466 [inline]
 shrink_node+0x115c/0x2790 mm/vmscan.c:6501
 shrink_zones mm/vmscan.c:6736 [inline]
 do_try_to_free_pages+0x67e/0x1900 mm/vmscan.c:6798
 try_to_free_mem_cgroup_pages+0x455/0xa50 mm/vmscan.c:7113
 try_charge_memcg+0x5de/0x16d0 mm/memcontrol.c:2724
 try_charge mm/memcontrol.c:2866 [inline]
 mem_cgroup_charge_skmem+0xad/0x2b0 mm/memcontrol.c:7351
 sock_reserve_memory+0x101/0x610 net/core/sock.c:1025
 sk_setsockopt+0xc8e/0x3430 net/core/sock.c:1520
 __sys_setsockopt+0x47b/0x980 net/socket.c:2269
 __do_sys_setsockopt net/socket.c:2284 [inline]
 __se_sys_setsockopt net/socket.c:2281 [inline]
 __x64_sys_setsockopt+0xb5/0xd0 net/socket.c:2281
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

The buggy address belongs to the object at ffff888029b761f0
 which belongs to the cache jfs_mp of size 184
The buggy address is located 40 bytes inside of
 freed 184-byte region [ffff888029b761f0, ffff888029b762a8)

The buggy address belongs to the physical page:
page:ffffea0000a6dd80 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x29b76
flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 00fff00000000200 ffff888142ae6000 dead000000000122 0000000000000000
raw: 0000000000000000 0000000080100010 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 0x192800(GFP_NOWAIT|__GFP_NOWARN|__GFP_NORETRY|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 5082, tgid 5073 (syz-executor361), ts 74009954920, free_ts 73972179887
 set_page_owner include/linux/page_owner.h:31 [inline]
 post_alloc_hook+0x1e6/0x210 mm/page_alloc.c:1731
 prep_new_page mm/page_alloc.c:1738 [inline]
 get_page_from_freelist+0x321c/0x33a0 mm/page_alloc.c:3502
 __alloc_pages+0x255/0x670 mm/page_alloc.c:4768
 alloc_slab_page+0x6a/0x160 mm/slub.c:1851
 allocate_slab mm/slub.c:1998 [inline]
 new_slab+0x84/0x2f0 mm/slub.c:2051
 ___slab_alloc+0xa85/0x10a0 mm/slub.c:3192
 __slab_alloc mm/slub.c:3291 [inline]
 __slab_alloc_node mm/slub.c:3344 [inline]
 slab_alloc_node mm/slub.c:3441 [inline]
 slab_alloc mm/slub.c:3459 [inline]
 __kmem_cache_alloc_lru mm/slub.c:3466 [inline]
 kmem_cache_alloc+0x1b9/0x2e0 mm/slub.c:3475
 mempool_alloc+0x194/0x580 mm/mempool.c:398
 alloc_metapage fs/jfs/jfs_metapage.c:176 [inline]
 __get_metapage+0x574/0x10e0 fs/jfs/jfs_metapage.c:651
 diNewExt+0xbe0/0x4000 fs/jfs/jfs_imap.c:2265
 diAllocExt fs/jfs/jfs_imap.c:1945 [inline]
 diAllocAG+0xbe8/0x1e50 fs/jfs/jfs_imap.c:1662
 diAlloc+0x3e1/0x1720 fs/jfs/jfs_imap.c:1583
 ialloc+0x8f/0x980 fs/jfs/jfs_inode.c:56
 jfs_mkdir+0x1c5/0xbb0 fs/jfs/namei.c:225
 vfs_mkdir+0x29d/0x450 fs/namei.c:4115
 do_mkdirat+0x264/0x520 fs/namei.c:4138
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:24 [inline]
 free_pages_prepare mm/page_alloc.c:1302 [inline]
 free_unref_page_prepare+0x903/0xa30 mm/page_alloc.c:2564
 free_unref_page+0x37/0x3f0 mm/page_alloc.c:2659
 qlist_free_all+0x22/0x60 mm/kasan/quarantine.c:185
 kasan_quarantine_reduce+0x14b/0x160 mm/kasan/quarantine.c:292
 __kasan_slab_alloc+0x23/0x70 mm/kasan/common.c:305
 kasan_slab_alloc include/linux/kasan.h:186 [inline]
 slab_post_alloc_hook+0x68/0x3a0 mm/slab.h:711
 slab_alloc_node mm/slub.c:3451 [inline]
 __kmem_cache_alloc_node+0x14c/0x290 mm/slub.c:3490
 __do_kmalloc_node mm/slab_common.c:965 [inline]
 __kmalloc_node+0xa7/0x230 mm/slab_common.c:973
 kmalloc_node include/linux/slab.h:579 [inline]
 kvmalloc_node+0x72/0x180 mm/util.c:604
 kvmalloc include/linux/slab.h:697 [inline]
 seq_buf_alloc fs/seq_file.c:38 [inline]
 seq_read_iter+0x202/0xd10 fs/seq_file.c:210
 call_read_iter include/linux/fs.h:1862 [inline]
 new_sync_read fs/read_write.c:389 [inline]
 vfs_read+0x788/0xb00 fs/read_write.c:470
 ksys_read+0x1a0/0x2c0 fs/read_write.c:613
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

Memory state around the buggy address:
 ffff888029b76100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888029b76180: fb fb fb fb fb fb fc fc fc fc fc fc fc fc fa fb
>ffff888029b76200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                            ^
 ffff888029b76280: fb fb fb fb fb fc fc fc fc fc fc fc fc fc fc fc
 ffff888029b76300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================


---
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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [syzbot] [jfs?] KASAN: use-after-free Read in release_metapage
  2023-01-02 10:00 [syzbot] [jfs?] KASAN: use-after-free Read in release_metapage syzbot
  2023-05-19  4:17 ` syzbot
@ 2024-08-03 19:28 ` syzbot
  1 sibling, 0 replies; 3+ messages in thread
From: syzbot @ 2024-08-03 19:28 UTC (permalink / raw)
  To: axboe, brauner, damien.lemoal, jack, jfs-discussion, jlayton, kch,
	linux-fsdevel, linux-kernel, shaggy, syzkaller-bugs, willy

syzbot suspects this issue was fixed by commit:

commit 6f861765464f43a71462d52026fbddfc858239a5
Author: Jan Kara <jack@suse.cz>
Date:   Wed Nov 1 17:43:10 2023 +0000

    fs: Block writes to mounted block devices

bisection log:  https://syzkaller.appspot.com/x/bisect.txt?x=15d6414b980000
start commit:   4d6d4c7f541d Merge tag 'linux-kselftest-fixes-6.4-rc3' of ..
git tree:       upstream
kernel config:  https://syzkaller.appspot.com/x/.config?x=94af80bb8ddd23c4
dashboard link: https://syzkaller.appspot.com/bug?extid=f1521383cec5f7baaa94
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=13385bd6280000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=11c11186280000

If the result looks correct, please mark the issue as fixed by replying with:

#syz fix: fs: Block writes to mounted block devices

For information about bisection process see: https://goo.gl/tpsmEJ#bisection

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-08-03 19:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-02 10:00 [syzbot] [jfs?] KASAN: use-after-free Read in release_metapage syzbot
2023-05-19  4:17 ` syzbot
2024-08-03 19:28 ` syzbot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox