syzbot


KASAN: use-after-free Read in kobject_put

Status: auto-closed as invalid on 2020/03/31 01:40
Reported-by: syzbot+32320e2809c7e17648d7@syzkaller.appspotmail.com
First crash: 1818d, last: 1818d
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: use-after-free Read in kobject_put kernel C 12 2095d 2226d 11/28 fixed on 2019/03/28 12:00
linux-4.19 KASAN: use-after-free Read in kobject_put 1 1818d 1818d 0/1 auto-closed as invalid on 2020/03/31 04:14

Sample crash report:
R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000000006
R13: 00000000004ca8c7 R14: 00000000004e3aa8 R15: 0000000000000005
input: syz1 as /devices/virtual/input/input88
==================================================================
BUG: KASAN: use-after-free in kobject_cleanup lib/kobject.c:630 [inline]
BUG: KASAN: use-after-free in kobject_release lib/kobject.c:675 [inline]
BUG: KASAN: use-after-free in kref_put include/linux/kref.h:70 [inline]
BUG: KASAN: use-after-free in kobject_put.cold+0x2e7/0x2f9 lib/kobject.c:692
Read of size 1 at addr ffff8880549fdd24 by task syz-executor.4/18740

CPU: 1 PID: 18740 Comm: syz-executor.4 Not tainted 4.14.157-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
SELinux: unrecognized netlink message: protocol=9 nlmsg_type=0 sclass=netlink_audit_socket pig=18749 comm=syz-executor.5
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x142/0x197 lib/dump_stack.c:58
SELinux: unrecognized netlink message: protocol=9 nlmsg_type=0 sclass=netlink_audit_socket pig=18749 comm=syz-executor.5
SELinux: unrecognized netlink message: protocol=9 nlmsg_type=0 sclass=netlink_audit_socket pig=18749 comm=syz-executor.5
 print_address_description.cold+0x7c/0x1dc mm/kasan/report.c:252
 kasan_report_error mm/kasan/report.c:351 [inline]
 kasan_report mm/kasan/report.c:409 [inline]
 kasan_report.cold+0xa9/0x2af mm/kasan/report.c:393
 __asan_report_load1_noabort+0x14/0x20 mm/kasan/report.c:427
 kobject_cleanup lib/kobject.c:630 [inline]
 kobject_release lib/kobject.c:675 [inline]
 kref_put include/linux/kref.h:70 [inline]
 kobject_put.cold+0x2e7/0x2f9 lib/kobject.c:692
 cdev_put.part.0+0x39/0x50 fs/char_dev.c:374
 cdev_put+0x20/0x30 fs/char_dev.c:372
 __fput+0x648/0x7a0 fs/file_table.c:214
 ____fput+0x16/0x20 fs/file_table.c:244
SELinux: unrecognized netlink message: protocol=9 nlmsg_type=0 sclass=netlink_audit_socket pig=18749 comm=syz-executor.5
 task_work_run+0x114/0x190 kernel/task_work.c:113
 tracehook_notify_resume include/linux/tracehook.h:191 [inline]
 exit_to_usermode_loop+0x1da/0x220 arch/x86/entry/common.c:164
 prepare_exit_to_usermode arch/x86/entry/common.c:199 [inline]
 syscall_return_slowpath arch/x86/entry/common.c:270 [inline]
 do_syscall_64+0x4bc/0x640 arch/x86/entry/common.c:297
 entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x45a679
RSP: 002b:00007fd4f7e43c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000021
RAX: 0000000000000004 RBX: 0000000000000002 RCX: 000000000045a679
RDX: 0000000000000000 RSI: 0000000000000004 RDI: 000000000000000b
RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007fd4f7e446d4
R13: 00000000004c0f40 R14: 00000000004d4aa8 R15: 00000000ffffffff
SELinux: unrecognized netlink message: protocol=9 nlmsg_type=0 sclass=netlink_audit_socket pig=18749 comm=syz-executor.5

Allocated by task 18734:
 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]
 kzalloc include/linux/slab.h:661 [inline]
 evdev_connect+0x76/0x4a0 drivers/input/evdev.c:1383
 input_attach_handler+0x154/0x1a0 drivers/input/input.c:1004
SELinux: unrecognized netlink message: protocol=9 nlmsg_type=0 sclass=netlink_audit_socket pig=18749 comm=syz-executor.5
 input_register_device.cold+0xbf/0x202 drivers/input/input.c:2161
 uinput_create_device drivers/input/misc/uinput.c:324 [inline]
 uinput_ioctl_handler.isra.0+0xdc8/0x18a0 drivers/input/misc/uinput.c:839
 uinput_ioctl+0x4a/0x60 drivers/input/misc/uinput.c:1010
SELinux: unrecognized netlink message: protocol=9 nlmsg_type=0 sclass=netlink_audit_socket pig=18749 comm=syz-executor.5
 vfs_ioctl fs/ioctl.c:46 [inline]
 file_ioctl fs/ioctl.c:500 [inline]
 do_vfs_ioctl+0x7ae/0x1060 fs/ioctl.c:684
 SYSC_ioctl fs/ioctl.c:701 [inline]
 SyS_ioctl+0x8f/0xc0 fs/ioctl.c:692
 do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292
SELinux: unrecognized netlink message: protocol=9 nlmsg_type=0 sclass=netlink_audit_socket pig=18749 comm=syz-executor.5
 entry_SYSCALL_64_after_hwframe+0x42/0xb7

Freed by task 18765:
 save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59
kobject: 'loop3' (ffff8880a4086360): kobject_uevent_env
 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
 evdev_free+0x5e/0x70 drivers/input/evdev.c:364
 device_release+0x7b/0x1a0 drivers/base/core.c:821
 kobject_cleanup lib/kobject.c:646 [inline]
 kobject_release lib/kobject.c:675 [inline]
 kref_put include/linux/kref.h:70 [inline]
 kobject_put.cold+0x269/0x2f9 lib/kobject.c:692
 cdev_default_release+0x41/0x50 fs/char_dev.c:613
 kobject_cleanup lib/kobject.c:646 [inline]
 kobject_release lib/kobject.c:675 [inline]
 kref_put include/linux/kref.h:70 [inline]
 kobject_put.cold+0x269/0x2f9 lib/kobject.c:692
 cdev_put.part.0+0x39/0x50 fs/char_dev.c:374
 cdev_put fs/char_dev.c:372 [inline]
 chrdev_open+0x266/0x590 fs/char_dev.c:431
 do_dentry_open+0x73b/0xeb0 fs/open.c:777
 vfs_open+0x105/0x220 fs/open.c:891
 do_last fs/namei.c:3425 [inline]
 path_openat+0x8bd/0x3f70 fs/namei.c:3566
 do_filp_open+0x18e/0x250 fs/namei.c:3600
 do_sys_open+0x2c5/0x430 fs/open.c:1084
 SYSC_open fs/open.c:1102 [inline]
 SyS_open+0x2d/0x40 fs/open.c:1097
 do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292
kobject: 'loop3' (ffff8880a4086360): fill_kobj_path: path = '/devices/virtual/block/loop3'
 entry_SYSCALL_64_after_hwframe+0x42/0xb7

The buggy address belongs to the object at ffff8880549fd740
 which belongs to the cache kmalloc-2048 of size 2048
The buggy address is located 1508 bytes inside of
 2048-byte region [ffff8880549fd740, ffff8880549fdf40)
The buggy address belongs to the page:
page:ffffea0001527f00 count:1 mapcount:0 mapping:ffff8880549fc640 index:0x0 compound_mapcount: 0
flags: 0xfffe0000008100(slab|head)
raw: 00fffe0000008100 ffff8880549fc640 0000000000000000 0000000100000003
raw: ffffea000176e620 ffffea0002a71720 ffff8880aa800c40 0000000000000000
hfsplus: session requires an argument
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8880549fdc00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8880549fdc80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8880549fdd00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                               ^
 ffff8880549fdd80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8880549fde00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
kobject: 'event4' (ffff888084718ff8): kobject_add_internal: parent: 'input88', set: 'devices'
hfsplus: unable to parse mount options
kobject: 'event4' (ffff888084718ff8): kobject_uevent_env

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/12/02 01:39 linux-4.14.y fbc5fe7a54d0 f879db37 .config console log report ci2-linux-4-14
* Struck through repros no longer work on HEAD.