linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* KASAN: use-after-free Read in search_by_entry_key
@ 2020-10-08 14:59 syzbot
  0 siblings, 0 replies; 4+ messages in thread
From: syzbot @ 2020-10-08 14:59 UTC (permalink / raw)
  To: akpm, colin.king, jack, jeffm, linux-kernel, reiserfs-devel,
	syzkaller-bugs

Hello,

syzbot found the following issue on:

HEAD commit:    c85fb28b Merge tag 'arm64-fixes' of git://git.kernel.org/p..
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=136fa1fb900000
kernel config:  https://syzkaller.appspot.com/x/.config?x=de7f697da23057c7
dashboard link: https://syzkaller.appspot.com/bug?extid=83b6f7cf9922cae5c4d7
compiler:       clang version 10.0.0 (https://github.com/llvm/llvm-project/ c2443155a0fb245c8f17f2c1c72b6ea391e86e81)
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=17ef5d4f900000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=11396677900000

Bisection is inconclusive: the issue happens on the oldest tested release.

bisection log:  https://syzkaller.appspot.com/x/bisect.txt?x=13e47620500000
final oops:     https://syzkaller.appspot.com/x/report.txt?x=10147620500000
console output: https://syzkaller.appspot.com/x/log.txt?x=17e47620500000

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

REISERFS (device loop0): journal params: device loop0, size 15748, journal first block 18, max trans len 1024, max batch 900, max commit age 30, max trans age 30
REISERFS (device loop0): checking transaction log (loop0)
REISERFS (device loop0): Using r5 hash to sort names
REISERFS (device loop0): using 3.5.x disk format
==================================================================
BUG: KASAN: use-after-free in bin_search_in_dir_item fs/reiserfs/namei.c:40 [inline]
BUG: KASAN: use-after-free in search_by_entry_key+0x450/0xad0 fs/reiserfs/namei.c:164
Read of size 4 at addr ffff88807cd0b7bd by task syz-executor710/6847

CPU: 1 PID: 6847 Comm: syz-executor710 Not tainted 5.9.0-rc8-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x1d6/0x29e lib/dump_stack.c:118
 print_address_description+0x66/0x620 mm/kasan/report.c:383
 __kasan_report mm/kasan/report.c:513 [inline]
 kasan_report+0x132/0x1d0 mm/kasan/report.c:530
 bin_search_in_dir_item fs/reiserfs/namei.c:40 [inline]
 search_by_entry_key+0x450/0xad0 fs/reiserfs/namei.c:164
 reiserfs_find_entry+0x246/0x1260 fs/reiserfs/namei.c:321
 reiserfs_lookup+0x156/0x3a0 fs/reiserfs/namei.c:367
 __lookup_slow+0x240/0x370 fs/namei.c:1544
 lookup_one_len+0x10e/0x200 fs/namei.c:2562
 reiserfs_lookup_privroot+0x85/0x1e0 fs/reiserfs/xattr.c:972
 reiserfs_fill_super+0x2b51/0x3240 fs/reiserfs/super.c:2176
 mount_bdev+0x24f/0x360 fs/super.c:1417
 legacy_get_tree+0xea/0x180 fs/fs_context.c:592
 vfs_get_tree+0x88/0x270 fs/super.c:1547
 do_new_mount fs/namespace.c:2875 [inline]
 path_mount+0x179d/0x29e0 fs/namespace.c:3192
 do_mount fs/namespace.c:3205 [inline]
 __do_sys_mount fs/namespace.c:3413 [inline]
 __se_sys_mount+0x126/0x180 fs/namespace.c:3390
 do_syscall_64+0x31/0x70 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x447d9a
Code: b8 08 00 00 00 0f 05 48 3d 01 f0 ff ff 0f 83 7d a3 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 0f 83 5a a3 fb ff c3 66 0f 1f 84 00 00 00 00 00
RSP: 002b:00007ffc5d05d468 EFLAGS: 00000297 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007ffc5d05d4c0 RCX: 0000000000447d9a
RDX: 0000000020000000 RSI: 0000000020000100 RDI: 00007ffc5d05d480
RBP: 00007ffc5d05d480 R08: 00007ffc5d05d4c0 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000297 R12: 0000000000000006
R13: 0000000000000004 R14: 0000000000000003 R15: 0000000000000003

The buggy address belongs to the page:
page:0000000023b676e0 refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x7cd0b
flags: 0xfffe0000000000()
raw: 00fffe0000000000 ffffea0001f34308 ffffea0001f34288 0000000000000000
raw: 0000000000000001 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff88807cd0b680: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff88807cd0b700: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff88807cd0b780: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
                                        ^
 ffff88807cd0b800: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff88807cd0b880: 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.
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

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

* Re: KASAN use-after-free Read in search_by_entry_key
  2023-10-24 10:08 ` Jan Kara
@ 2023-10-24 11:33   ` Christian Brauner
  0 siblings, 0 replies; 4+ messages in thread
From: Christian Brauner @ 2023-10-24 11:33 UTC (permalink / raw)
  To: Jan Kara; +Cc: Yikebaer Aizezi, reiserfs-devel, dchinner, jlayton, linux-kernel

On Tue, Oct 24, 2023 at 12:08:34PM +0200, Jan Kara wrote:
> Hello!
> 
> On Tue 24-10-23 10:30:46, Yikebaer Aizezi wrote:
> > When using Healer to fuzz the  Linux 6.6-rc7 Linux kernel,  the following crash
> > was triggered.
> 
> Thanks for report but I don't think there's a big interest in fixing
> reiserfs errors found by a fuzzer. Reiserfs is scheduled for removal from
> the kernel so it would be mostly a wasted effort.

Agreed, but also note that this is from a private syzkaller instance
with google drive links which makes me shy away from this tbh.

I don't think we should encourage private syzbot reports as that will
end up a nightmare for us all.

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

* Re: KASAN use-after-free Read in search_by_entry_key
  2023-10-24  2:30 KASAN " Yikebaer Aizezi
@ 2023-10-24 10:08 ` Jan Kara
  2023-10-24 11:33   ` Christian Brauner
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Kara @ 2023-10-24 10:08 UTC (permalink / raw)
  To: Yikebaer Aizezi
  Cc: reiserfs-devel, brauner, dchinner, jack, jlayton, linux-kernel

Hello!

On Tue 24-10-23 10:30:46, Yikebaer Aizezi wrote:
> When using Healer to fuzz the  Linux 6.6-rc7 Linux kernel,  the following crash
> was triggered.

Thanks for report but I don't think there's a big interest in fixing
reiserfs errors found by a fuzzer. Reiserfs is scheduled for removal from
the kernel so it would be mostly a wasted effort.

								Honza

> 
> HEAD commit: 05d3ef8bba77c1b5f98d941d8b2d4aeab8118ef1 ( Linux 6.6-rc7)
> git tree: upstream
> 
> console output:
> https://drive.google.com/file/d/1qQhQwRydIp1SIiDJghcfp384uZ3gF8-T/view?usp=drive_link
> kernel config:https://drive.google.com/file/d/1gOeRhOnJr2htj6PPnEDTFUkli94JwVvJ/view?usp=drive_link
> C reproducer:https://drive.google.com/file/d/19te0q4_oUfcCoMarjNmkWXvnuwyvhRL-/view?usp=drive_link
> Syzlang reproducer:
> https://drive.google.com/file/d/12vmCNO8HysQ9-C5TC90mpjmZXOJ90k8C/view?usp=drive_link
> 
> If you fix this issue, please add the following tag to the commit:
> Reported-by: Yikebaer Aizezi <yikebaer61@gmail.com>
> 
> ==================================================================
> BUG: KASAN: use-after-free in search_by_entry_key+0x81f/0x960
> fs/reiserfs/namei.c:165
> Read of size 4 at addr ffff8880316dcfc4 by task syz-executor.0/41572
> 
> CPU: 0 PID: 41572 Comm: syz-executor.0 Not tainted 6.6.0-rc7-g05d3ef8bba77 #8
> Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
> rel-1.12.0-59-gc9ba5276e321-prebuilt.qemu.org 04/01/2014
> Call Trace:
>  <TASK>
>  __dump_stack lib/dump_stack.c:88 [inline]
>  dump_stack_lvl+0xd5/0x150 lib/dump_stack.c:106
>  print_address_description mm/kasan/report.c:364 [inline]
>  print_report+0xc1/0x5e0 mm/kasan/report.c:475
>  kasan_report+0xba/0xf0 mm/kasan/report.c:588
>  bin_search_in_dir_item fs/reiserfs/namei.c:40 [inline]
>  search_by_entry_key+0x81f/0x960 fs/reiserfs/namei.c:165
>  reiserfs_find_entry.part.0+0x139/0xdf0 fs/reiserfs/namei.c:322
>  reiserfs_find_entry fs/reiserfs/namei.c:392 [inline]
>  reiserfs_lookup+0x24d/0x610 fs/reiserfs/namei.c:368
>  __lookup_slow+0x24c/0x460 fs/namei.c:1694
>  lookup_one_len+0x16a/0x1a0 fs/namei.c:2746
>  reiserfs_lookup_privroot+0x92/0x210 fs/reiserfs/xattr.c:977
>  reiserfs_fill_super+0x20fa/0x2ea0 fs/reiserfs/super.c:2174
>  mount_bdev+0x1fd/0x2f0 fs/super.c:1629
>  legacy_get_tree+0x105/0x220 fs/fs_context.c:662
>  vfs_get_tree+0x8d/0x370 fs/super.c:1750
>  do_new_mount fs/namespace.c:3335 [inline]
>  path_mount+0x671/0x1e40 fs/namespace.c:3662
>  do_mount fs/namespace.c:3675 [inline]
>  __do_sys_mount fs/namespace.c:3884 [inline]
>  __se_sys_mount fs/namespace.c:3861 [inline]
>  __x64_sys_mount+0x27f/0x300 fs/namespace.c:3861
>  do_syscall_x64 arch/x86/entry/common.c:50 [inline]
>  do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
>  entry_SYSCALL_64_after_hwframe+0x63/0xcd
> RIP: 0033:0x7ff4f9690abe
> Code: 48 c7 c0 ff ff ff ff eb aa e8 be 0d 00 00 66 2e 0f 1f 84 00 00
> 00 00 00 0f 1f 40 00 f3 0f 1e fa 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d
> 01 f0 ff ff 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48
> RSP: 002b:00007ff4fa3bde38 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5
> RAX: ffffffffffffffda RBX: 000000000000ffe6 RCX: 00007ff4f9690abe
> RDX: 0000000020010000 RSI: 0000000020010040 RDI: 00007ff4fa3bde90
> RBP: 00007ff4fa3bded0 R08: 00007ff4fa3bded0 R09: 0000000000000000
> R10: 0000000000000000 R11: 0000000000000202 R12: 0000000020010000
> R13: 0000000020010040 R14: 00007ff4fa3bde90 R15: 00000000200005c0
>  </TASK>
> 
> The buggy address belongs to the physical page:
> page:ffffea0000c5b700 refcount:0 mapcount:0 mapping:0000000000000000
> index:0x1 pfn:0x316dc
> flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
> page_type: 0xffffffff()
> raw: 00fff00000000000 dead000000000100 dead000000000122 0000000000000000
> raw: 0000000000000001 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
> 0x140cca(GFP_HIGHUSER_MOVABLE|__GFP_COMP), pid 41568, tgid 41567
> (syz-executor.2), ts 1584644584471, free_ts 1585399046358
>  prep_new_page mm/page_alloc.c:1543 [inline]
>  get_page_from_freelist+0xf09/0x2c50 mm/page_alloc.c:3170
>  __alloc_pages+0x1c7/0x490 mm/page_alloc.c:4426
>  __folio_alloc+0x12/0x40 mm/page_alloc.c:4458
>  vma_alloc_folio+0x153/0x870 mm/mempolicy.c:2258
>  shmem_alloc_folio+0x121/0x1f0 mm/shmem.c:1658
>  shmem_alloc_and_acct_folio+0xd2/0x150 mm/shmem.c:1683
>  shmem_get_folio_gfp+0x96b/0x18e0 mm/shmem.c:2020
>  shmem_get_folio mm/shmem.c:2143 [inline]
>  shmem_write_begin+0x146/0x440 mm/shmem.c:2688
>  generic_perform_write+0x267/0x5d0 mm/filemap.c:3969
>  shmem_file_write_iter+0x10f/0x140 mm/shmem.c:2865
>  call_write_iter include/linux/fs.h:1956 [inline]
>  new_sync_write fs/read_write.c:491 [inline]
>  vfs_write+0x989/0xdb0 fs/read_write.c:584
>  ksys_write+0x11e/0x240 fs/read_write.c:637
>  do_syscall_x64 arch/x86/entry/common.c:50 [inline]
>  do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
>  entry_SYSCALL_64_after_hwframe+0x63/0xcd
> page last free stack trace:
>  reset_page_owner include/linux/page_owner.h:24 [inline]
>  free_pages_prepare mm/page_alloc.c:1136 [inline]
>  free_unref_page_prepare+0x450/0xa30 mm/page_alloc.c:2312
>  free_unref_page_list+0xec/0xac0 mm/page_alloc.c:2451
>  release_pages+0xca9/0x1350 mm/swap.c:1042
>  __folio_batch_release+0x73/0xd0 mm/swap.c:1062
>  folio_batch_release include/linux/pagevec.h:83 [inline]
>  shmem_undo_range+0x545/0x10f0 mm/shmem.c:1022
>  shmem_truncate_range mm/shmem.c:1114 [inline]
>  shmem_evict_inode+0x38a/0xb70 mm/shmem.c:1243
>  evict+0x2ed/0x6b0 fs/inode.c:664
>  iput_final fs/inode.c:1775 [inline]
>  iput.part.0+0x50f/0x710 fs/inode.c:1801
>  iput+0x58/0x70 fs/inode.c:1791
>  dentry_unlink_inode+0x28c/0x430 fs/dcache.c:401
>  __dentry_kill+0x3bd/0x640 fs/dcache.c:607
>  dentry_kill fs/dcache.c:733 [inline]
>  dput+0x847/0xde0 fs/dcache.c:913
>  __fput+0x543/0xa70 fs/file_table.c:392
>  task_work_run+0x164/0x250 kernel/task_work.c:180
>  resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
>  exit_to_user_mode_loop kernel/entry/common.c:171 [inline]
>  exit_to_user_mode_prepare+0x215/0x240 kernel/entry/common.c:204
>  __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline]
>  syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:296
> 
> Memory state around the buggy address:
>  ffff8880316dce80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>  ffff8880316dcf00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> >ffff8880316dcf80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>                                            ^
>  ffff8880316dd000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>  ffff8880316dd080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> ==================================================================
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

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

* KASAN use-after-free Read in search_by_entry_key
@ 2023-10-24  2:30 Yikebaer Aizezi
  2023-10-24 10:08 ` Jan Kara
  0 siblings, 1 reply; 4+ messages in thread
From: Yikebaer Aizezi @ 2023-10-24  2:30 UTC (permalink / raw)
  To: reiserfs-devel; +Cc: brauner, dchinner, jack, jlayton, linux-kernel

Hello,

When using Healer to fuzz the  Linux 6.6-rc7 Linux kernel,  the following crash
was triggered.

HEAD commit: 05d3ef8bba77c1b5f98d941d8b2d4aeab8118ef1 ( Linux 6.6-rc7)
git tree: upstream

console output:
https://drive.google.com/file/d/1qQhQwRydIp1SIiDJghcfp384uZ3gF8-T/view?usp=drive_link
kernel config:https://drive.google.com/file/d/1gOeRhOnJr2htj6PPnEDTFUkli94JwVvJ/view?usp=drive_link
C reproducer:https://drive.google.com/file/d/19te0q4_oUfcCoMarjNmkWXvnuwyvhRL-/view?usp=drive_link
Syzlang reproducer:
https://drive.google.com/file/d/12vmCNO8HysQ9-C5TC90mpjmZXOJ90k8C/view?usp=drive_link

If you fix this issue, please add the following tag to the commit:
Reported-by: Yikebaer Aizezi <yikebaer61@gmail.com>

==================================================================
BUG: KASAN: use-after-free in search_by_entry_key+0x81f/0x960
fs/reiserfs/namei.c:165
Read of size 4 at addr ffff8880316dcfc4 by task syz-executor.0/41572

CPU: 0 PID: 41572 Comm: syz-executor.0 Not tainted 6.6.0-rc7-g05d3ef8bba77 #8
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
rel-1.12.0-59-gc9ba5276e321-prebuilt.qemu.org 04/01/2014
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xd5/0x150 lib/dump_stack.c:106
 print_address_description mm/kasan/report.c:364 [inline]
 print_report+0xc1/0x5e0 mm/kasan/report.c:475
 kasan_report+0xba/0xf0 mm/kasan/report.c:588
 bin_search_in_dir_item fs/reiserfs/namei.c:40 [inline]
 search_by_entry_key+0x81f/0x960 fs/reiserfs/namei.c:165
 reiserfs_find_entry.part.0+0x139/0xdf0 fs/reiserfs/namei.c:322
 reiserfs_find_entry fs/reiserfs/namei.c:392 [inline]
 reiserfs_lookup+0x24d/0x610 fs/reiserfs/namei.c:368
 __lookup_slow+0x24c/0x460 fs/namei.c:1694
 lookup_one_len+0x16a/0x1a0 fs/namei.c:2746
 reiserfs_lookup_privroot+0x92/0x210 fs/reiserfs/xattr.c:977
 reiserfs_fill_super+0x20fa/0x2ea0 fs/reiserfs/super.c:2174
 mount_bdev+0x1fd/0x2f0 fs/super.c:1629
 legacy_get_tree+0x105/0x220 fs/fs_context.c:662
 vfs_get_tree+0x8d/0x370 fs/super.c:1750
 do_new_mount fs/namespace.c:3335 [inline]
 path_mount+0x671/0x1e40 fs/namespace.c:3662
 do_mount fs/namespace.c:3675 [inline]
 __do_sys_mount fs/namespace.c:3884 [inline]
 __se_sys_mount fs/namespace.c:3861 [inline]
 __x64_sys_mount+0x27f/0x300 fs/namespace.c:3861
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7ff4f9690abe
Code: 48 c7 c0 ff ff ff ff eb aa e8 be 0d 00 00 66 2e 0f 1f 84 00 00
00 00 00 0f 1f 40 00 f3 0f 1e fa 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d
01 f0 ff ff 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ff4fa3bde38 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 000000000000ffe6 RCX: 00007ff4f9690abe
RDX: 0000000020010000 RSI: 0000000020010040 RDI: 00007ff4fa3bde90
RBP: 00007ff4fa3bded0 R08: 00007ff4fa3bded0 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000202 R12: 0000000020010000
R13: 0000000020010040 R14: 00007ff4fa3bde90 R15: 00000000200005c0
 </TASK>

The buggy address belongs to the physical page:
page:ffffea0000c5b700 refcount:0 mapcount:0 mapping:0000000000000000
index:0x1 pfn:0x316dc
flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 00fff00000000000 dead000000000100 dead000000000122 0000000000000000
raw: 0000000000000001 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
0x140cca(GFP_HIGHUSER_MOVABLE|__GFP_COMP), pid 41568, tgid 41567
(syz-executor.2), ts 1584644584471, free_ts 1585399046358
 prep_new_page mm/page_alloc.c:1543 [inline]
 get_page_from_freelist+0xf09/0x2c50 mm/page_alloc.c:3170
 __alloc_pages+0x1c7/0x490 mm/page_alloc.c:4426
 __folio_alloc+0x12/0x40 mm/page_alloc.c:4458
 vma_alloc_folio+0x153/0x870 mm/mempolicy.c:2258
 shmem_alloc_folio+0x121/0x1f0 mm/shmem.c:1658
 shmem_alloc_and_acct_folio+0xd2/0x150 mm/shmem.c:1683
 shmem_get_folio_gfp+0x96b/0x18e0 mm/shmem.c:2020
 shmem_get_folio mm/shmem.c:2143 [inline]
 shmem_write_begin+0x146/0x440 mm/shmem.c:2688
 generic_perform_write+0x267/0x5d0 mm/filemap.c:3969
 shmem_file_write_iter+0x10f/0x140 mm/shmem.c:2865
 call_write_iter include/linux/fs.h:1956 [inline]
 new_sync_write fs/read_write.c:491 [inline]
 vfs_write+0x989/0xdb0 fs/read_write.c:584
 ksys_write+0x11e/0x240 fs/read_write.c:637
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:24 [inline]
 free_pages_prepare mm/page_alloc.c:1136 [inline]
 free_unref_page_prepare+0x450/0xa30 mm/page_alloc.c:2312
 free_unref_page_list+0xec/0xac0 mm/page_alloc.c:2451
 release_pages+0xca9/0x1350 mm/swap.c:1042
 __folio_batch_release+0x73/0xd0 mm/swap.c:1062
 folio_batch_release include/linux/pagevec.h:83 [inline]
 shmem_undo_range+0x545/0x10f0 mm/shmem.c:1022
 shmem_truncate_range mm/shmem.c:1114 [inline]
 shmem_evict_inode+0x38a/0xb70 mm/shmem.c:1243
 evict+0x2ed/0x6b0 fs/inode.c:664
 iput_final fs/inode.c:1775 [inline]
 iput.part.0+0x50f/0x710 fs/inode.c:1801
 iput+0x58/0x70 fs/inode.c:1791
 dentry_unlink_inode+0x28c/0x430 fs/dcache.c:401
 __dentry_kill+0x3bd/0x640 fs/dcache.c:607
 dentry_kill fs/dcache.c:733 [inline]
 dput+0x847/0xde0 fs/dcache.c:913
 __fput+0x543/0xa70 fs/file_table.c:392
 task_work_run+0x164/0x250 kernel/task_work.c:180
 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
 exit_to_user_mode_loop kernel/entry/common.c:171 [inline]
 exit_to_user_mode_prepare+0x215/0x240 kernel/entry/common.c:204
 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline]
 syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:296

Memory state around the buggy address:
 ffff8880316dce80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff8880316dcf00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff8880316dcf80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
                                           ^
 ffff8880316dd000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff8880316dd080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================

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

end of thread, other threads:[~2023-10-24 11:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-08 14:59 KASAN: use-after-free Read in search_by_entry_key syzbot
2023-10-24  2:30 KASAN " Yikebaer Aizezi
2023-10-24 10:08 ` Jan Kara
2023-10-24 11:33   ` Christian Brauner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).