syzbot


KASAN: invalid-free in ceph_destroy_options

Status: upstream: reported syz repro on 2019/11/13 00:54
Reported-by: syzbot+190170a3d15199df2a22@syzkaller.appspotmail.com
First crash: 1871d, last: 1655d
Fix bisection the fix commit could be any of (bisect log):
  4762bcd451a9 Linux 4.14.153
  56dfe6252c68 Linux 4.14.188
  
Last patch testing requests (2)
Created Duration User Patch Repo Result
2023/01/26 17:32 10m retest repro linux-4.14.y report log
2022/09/08 07:27 8m retest repro linux-4.14.y report log
Fix bisection attempts (8)
Created Duration User Patch Repo Result
2020/07/15 18:40 38m bisect fix linux-4.14.y OK (2) job log
2020/06/15 18:08 32m bisect fix linux-4.14.y OK (0) job log log
2020/05/16 17:32 35m bisect fix linux-4.14.y OK (0) job log log
2020/04/16 16:57 34m bisect fix linux-4.14.y OK (0) job log log
2020/03/17 12:20 34m bisect fix linux-4.14.y OK (0) job log log
2020/02/16 11:41 36m bisect fix linux-4.14.y OK (0) job log log
2020/01/17 10:29 35m bisect fix linux-4.14.y OK (0) job log log
2019/12/18 09:38 34m bisect fix linux-4.14.y OK (0) job log log

Sample crash report:
libceph: mon0 [d::]:6789 connect error
syz-executor.5 cpuset=syz5 mems_allowed=0-1
syz-executor.4 cpuset=syz4 mems_allowed=0-1
==================================================================
BUG: KASAN: double-free or invalid-free in ceph_destroy_options+0xd4/0x110 net/ceph/ceph_common.c:288

CPU: 1 PID: 11706 Comm: syz-executor.2 Not tainted 4.14.153 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x138/0x197 lib/dump_stack.c:53
 print_address_description.cold+0x7c/0x1dc mm/kasan/report.c:252
 kasan_report_double_free+0x56/0x80 mm/kasan/report.c:333
 kasan_slab_free+0xa7/0xc0 mm/kasan/kasan.c:514
 __cache_free mm/slab.c:3496 [inline]
 kfree+0xcc/0x270 mm/slab.c:3815
 ceph_destroy_options+0xd4/0x110 net/ceph/ceph_common.c:288
 ceph_mount+0xb6d/0x1709 fs/ceph/super.c:1009
 mount_fs+0x97/0x2a1 fs/super.c:1237
 vfs_kern_mount.part.0+0x5e/0x3d0 fs/namespace.c:1046
 vfs_kern_mount fs/namespace.c:1036 [inline]
 do_new_mount fs/namespace.c:2549 [inline]
 do_mount+0x417/0x27d0 fs/namespace.c:2879
 SYSC_mount fs/namespace.c:3095 [inline]
 SyS_mount+0xab/0x120 fs/namespace.c:3072
 do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x45a219
RSP: 002b:00007f4326c98c78 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 0000000000000005 RCX: 000000000045a219
RDX: 0000000020000140 RSI: 00000000200000c0 RDI: 0000000020000500
RBP: 000000000075c070 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f4326c996d4
R13: 00000000004c6d95 R14: 00000000004dc508 R15: 00000000ffffffff

Allocated by task 11706:
 save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59
 save_stack+0x45/0xd0 mm/kasan/kasan.c:447
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_kmalloc mm/kasan/kasan.c:551 [inline]
 kasan_kmalloc+0xce/0xf0 mm/kasan/kasan.c:529
 kmem_cache_alloc_trace+0x152/0x790 mm/slab.c:3618
 kmalloc include/linux/slab.h:488 [inline]
 kmalloc_array include/linux/slab.h:606 [inline]
 kcalloc include/linux/slab.h:618 [inline]
 ceph_parse_options+0xfe/0xe80 net/ceph/ceph_common.c:352
 parse_mount_options fs/ceph/super.c:466 [inline]
 ceph_mount+0x3c1/0x1709 fs/ceph/super.c:998
 mount_fs+0x97/0x2a1 fs/super.c:1237
 vfs_kern_mount.part.0+0x5e/0x3d0 fs/namespace.c:1046
 vfs_kern_mount fs/namespace.c:1036 [inline]
 do_new_mount fs/namespace.c:2549 [inline]
 do_mount+0x417/0x27d0 fs/namespace.c:2879
 SYSC_mount fs/namespace.c:3095 [inline]
 SyS_mount+0xab/0x120 fs/namespace.c:3072
 do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x42/0xb7

Freed by task 11706:
 save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59
 save_stack+0x45/0xd0 mm/kasan/kasan.c:447
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_slab_free+0x75/0xc0 mm/kasan/kasan.c:524
 __cache_free mm/slab.c:3496 [inline]
 kfree+0xcc/0x270 mm/slab.c:3815
 ceph_destroy_options+0xd4/0x110 net/ceph/ceph_common.c:288
 ceph_destroy_client+0x9d/0xc0 net/ceph/ceph_common.c:671
 create_fs_client fs/ceph/super.c:649 [inline]
 ceph_mount+0xb46/0x1709 fs/ceph/super.c:1005
 mount_fs+0x97/0x2a1 fs/super.c:1237
 vfs_kern_mount.part.0+0x5e/0x3d0 fs/namespace.c:1046
 vfs_kern_mount fs/namespace.c:1036 [inline]
 do_new_mount fs/namespace.c:2549 [inline]
 do_mount+0x417/0x27d0 fs/namespace.c:2879
 SYSC_mount fs/namespace.c:3095 [inline]
 SyS_mount+0xab/0x120 fs/namespace.c:3072
 do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x42/0xb7

The buggy address belongs to the object at ffff888082e61340
 which belongs to the cache kmalloc-8192 of size 8192
The buggy address is located 0 bytes inside of
 8192-byte region [ffff888082e61340, ffff888082e63340)
The buggy address belongs to the page:
page:ffffea00020b9800 count:1 mapcount:0 mapping:ffff888082e61340 index:0x0 compound_mapcount: 0
flags: 0x1fffc0000008100(slab|head)
raw: 01fffc0000008100 ffff888082e61340 0000000000000000 0000000100000001
raw: ffffea0001f1df20 ffffea00020b9720 ffff8880aa802080 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff888082e61200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff888082e61280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888082e61300: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb
                                           ^
 ffff888082e61380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888082e61400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/11/12 23:53 linux-4.14.y 4762bcd451a9 048f2d49 .config console log report syz ci2-linux-4-14
* Struck through repros no longer work on HEAD.