comedi comedi0: c6xdigio: I/O port conflict (0x4f2b,3) ================================================================== BUG: KASAN: slab-out-of-bounds in kernfs_root+0x290/0x2a0 fs/kernfs/kernfs-internal.h:76 Read of size 8 at addr ffff88806b3d34b0 by task syz.1.1941/12670 CPU: 3 UID: 0 PID: 12670 Comm: syz.1.1941 Not tainted syzkaller #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xcd/0x630 mm/kasan/report.c:482 kasan_report+0xe0/0x110 mm/kasan/report.c:595 kernfs_root+0x290/0x2a0 fs/kernfs/kernfs-internal.h:76 kernfs_remove_by_name_ns+0x2e/0x110 fs/kernfs/dir.c:1711 sysfs_remove_file include/linux/sysfs.h:777 [inline] driver_remove_file drivers/base/driver.c:201 [inline] driver_remove_file+0x4a/0x60 drivers/base/driver.c:197 remove_bind_files drivers/base/bus.c:605 [inline] bus_remove_driver+0x224/0x2c0 drivers/base/bus.c:743 driver_unregister+0x76/0xb0 drivers/base/driver.c:277 comedi_device_detach_locked+0x12c/0xa50 drivers/comedi/drivers.c:207 comedi_device_detach+0x67/0xb0 drivers/comedi/drivers.c:215 comedi_device_attach+0x43d/0x900 drivers/comedi/drivers.c:1010 do_devconfig_ioctl+0x1b1/0x710 drivers/comedi/comedi_fops.c:872 comedi_unlocked_ioctl+0x165d/0x2f00 drivers/comedi/comedi_fops.c:2173 comedi_compat_ioctl+0x1d0/0x990 drivers/comedi/comedi_fops.c:3244 __do_compat_sys_ioctl fs/ioctl.c:696 [inline] __se_compat_sys_ioctl fs/ioctl.c:639 [inline] __ia32_compat_sys_ioctl+0x23f/0x370 fs/ioctl.c:639 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] __do_fast_syscall_32+0x7c/0x3a0 arch/x86/entry/syscall_32.c:306 do_fast_syscall_32+0x32/0x80 arch/x86/entry/syscall_32.c:331 entry_SYSENTER_compat_after_hwframe+0x84/0x8e RIP: 0023:0xf708e579 Code: b8 01 10 06 03 74 b4 01 10 07 03 74 b0 01 10 08 03 74 d8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 8d b4 26 00 00 00 00 8d b4 26 00 00 00 00 RSP: 002b:00000000f547e55c EFLAGS: 00000296 ORIG_RAX: 0000000000000036 RAX: ffffffffffffffda RBX: 0000000000000006 RCX: 0000000040946400 RDX: 00000000800000c0 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000296 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 5969: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:388 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:405 kmalloc_noprof include/linux/slab.h:905 [inline] kzalloc_noprof include/linux/slab.h:1039 [inline] obj_cgroup_alloc mm/memcontrol.c:192 [inline] memcg_online_kmem mm/memcontrol.c:3284 [inline] mem_cgroup_css_online+0x5c/0x640 mm/memcontrol.c:3840 online_css+0xaf/0x350 kernel/cgroup/cgroup.c:5606 css_create kernel/cgroup/cgroup.c:5694 [inline] cgroup_apply_control_enable+0x702/0xbb0 kernel/cgroup/cgroup.c:3289 cgroup_mkdir+0x5e7/0x11f0 kernel/cgroup/cgroup.c:5893 kernfs_iop_mkdir+0x111/0x190 fs/kernfs/dir.c:1268 vfs_mkdir+0x590/0x8c0 fs/namei.c:4366 do_mkdirat+0x304/0x3e0 fs/namei.c:4399 __do_sys_mkdirat fs/namei.c:4416 [inline] __se_sys_mkdirat fs/namei.c:4414 [inline] __ia32_sys_mkdirat+0x82/0xb0 fs/namei.c:4414 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] __do_fast_syscall_32+0x7c/0x3a0 arch/x86/entry/syscall_32.c:306 do_fast_syscall_32+0x32/0x80 arch/x86/entry/syscall_32.c:331 entry_SYSENTER_compat_after_hwframe+0x84/0x8e The buggy address belongs to the object at ffff88806b3d3480 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 0 bytes to the right of allocated 48-byte region [ffff88806b3d3480, ffff88806b3d34b0) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff88806b3d3700 pfn:0x6b3d3 flags: 0x4fff00000000200(workingset|node=1|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 04fff00000000200 ffff88801b8428c0 ffffea0001bda990 ffffea0001bc6b90 raw: ffff88806b3d3700 0000000000200013 00000000f5000000 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 0x52cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 5970, tgid 5970 (syz-executor), ts 44191768923, free_ts 0 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1c0/0x230 mm/page_alloc.c:1851 prep_new_page mm/page_alloc.c:1859 [inline] get_page_from_freelist+0x132b/0x38e0 mm/page_alloc.c:3858 __alloc_frozen_pages_noprof+0x261/0x23f0 mm/page_alloc.c:5148 alloc_pages_mpol+0x1fb/0x550 mm/mempolicy.c:2416 alloc_slab_page mm/slub.c:2487 [inline] allocate_slab mm/slub.c:2655 [inline] new_slab+0x247/0x330 mm/slub.c:2709 ___slab_alloc+0xcf2/0x1740 mm/slub.c:3891 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3981 __slab_alloc_node mm/slub.c:4056 [inline] slab_alloc_node mm/slub.c:4217 [inline] __do_kmalloc_node mm/slub.c:4364 [inline] __kmalloc_noprof+0x2f2/0x510 mm/slub.c:4377 kmalloc_noprof include/linux/slab.h:909 [inline] kzalloc_noprof include/linux/slab.h:1039 [inline] kobject_get_path+0xd2/0x2a0 lib/kobject.c:161 kobject_uevent_env+0x289/0x1870 lib/kobject_uevent.c:545 __kobject_del+0x168/0x1f0 lib/kobject.c:601 kobject_cleanup lib/kobject.c:680 [inline] kobject_release lib/kobject.c:720 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x327/0x5a0 lib/kobject.c:737 net_rx_queue_update_kobjects+0x54d/0x770 net/core/net-sysfs.c:1336 netif_set_real_num_rx_queues+0x216/0x3b0 net/core/dev.c:3232 veth_init_queues+0x151/0x190 drivers/net/veth.c:1798 veth_newlink+0x4ec/0xa00 drivers/net/veth.c:1902 page_owner free stack trace missing Memory state around the buggy address: ffff88806b3d3380: 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc fc ffff88806b3d3400: 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc >ffff88806b3d3480: 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc ^ ffff88806b3d3500: 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc ffff88806b3d3580: 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc ================================================================== ---------------- Code disassembly (best guess), 2 bytes skipped: 0: 10 06 adc %al,(%rsi) 2: 03 74 b4 01 add 0x1(%rsp,%rsi,4),%esi 6: 10 07 adc %al,(%rdi) 8: 03 74 b0 01 add 0x1(%rax,%rsi,4),%esi c: 10 08 adc %cl,(%rax) e: 03 74 d8 01 add 0x1(%rax,%rbx,8),%esi 1e: 00 51 52 add %dl,0x52(%rcx) 21: 55 push %rbp 22: 89 e5 mov %esp,%ebp 24: 0f 34 sysenter 26: cd 80 int $0x80 * 28: 5d pop %rbp <-- trapping instruction 29: 5a pop %rdx 2a: 59 pop %rcx 2b: c3 ret 2c: 90 nop 2d: 90 nop 2e: 90 nop 2f: 90 nop 30: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi 37: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi