comedi comedi3: c6xdigio: I/O port conflict (0x2,3) ================================================================== BUG: KASAN: slab-out-of-bounds in kernfs_root+0x29a/0x2a0 fs/kernfs/kernfs-internal.h:79 Read of size 8 at addr ffff8880328a3578 by task syz.2.5619/24013 CPU: 1 UID: 0 PID: 24013 Comm: syz.2.5619 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+0x29a/0x2a0 fs/kernfs/kernfs-internal.h:79 kernfs_remove_by_name_ns+0x2e/0x110 fs/kernfs/dir.c:1711 sysfs_remove_file include/linux/sysfs.h:770 [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+0x12f/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:1011 do_devconfig_ioctl+0x1b1/0x710 drivers/comedi/comedi_fops.c:872 comedi_unlocked_ioctl+0x165d/0x2f00 drivers/comedi/comedi_fops.c:2178 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:597 [inline] __se_sys_ioctl fs/ioctl.c:583 [inline] __x64_sys_ioctl+0x18e/0x210 fs/ioctl.c:583 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0xfa0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f3858f8f7c9 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f3859d71038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f38591e5fa0 RCX: 00007f3858f8f7c9 RDX: 00002000000000c0 RSI: 0000000040946400 RDI: 0000000000000003 RBP: 00007f3859013f91 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f38591e6038 R14: 00007f38591e5fa0 R15: 00007fff5322cd48 Allocated by task 8179: kasan_save_stack+0x33/0x60 mm/kasan/common.c:56 kasan_save_track+0x14/0x30 mm/kasan/common.c:77 poison_kmalloc_redzone mm/kasan/common.c:400 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:417 kmalloc_noprof include/linux/slab.h:957 [inline] kzalloc_noprof include/linux/slab.h:1094 [inline] devlink_trap_register net/devlink/trap.c:1274 [inline] devl_traps_register net/devlink/trap.c:1366 [inline] devl_traps_register+0x383/0xb90 net/devlink/trap.c:1349 nsim_dev_traps_init+0x299/0x5d0 drivers/net/netdevsim/dev.c:920 nsim_dev_reload_create drivers/net/netdevsim/dev.c:1524 [inline] nsim_dev_reload_up+0x359/0x860 drivers/net/netdevsim/dev.c:1003 devlink_reload+0x325/0x7c0 net/devlink/dev.c:474 devlink_pernet_pre_exit+0x1a0/0x2b0 net/devlink/core.c:509 ops_pre_exit_list net/core/net_namespace.c:161 [inline] ops_undo_list+0x187/0xab0 net/core/net_namespace.c:234 cleanup_net+0x41b/0x8b0 net/core/net_namespace.c:695 process_one_work+0x9cf/0x1b70 kernel/workqueue.c:3263 process_scheduled_works kernel/workqueue.c:3346 [inline] worker_thread+0x6c8/0xf10 kernel/workqueue.c:3427 kthread+0x3c5/0x780 kernel/kthread.c:463 ret_from_fork+0x675/0x7d0 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 The buggy address belongs to the object at ffff8880328a3500 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 64 bytes to the right of allocated 56-byte region [ffff8880328a3500, ffff8880328a3538) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x328a3 ksm flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000000 ffff88801b4428c0 ffffea000159e4c0 dead000000000003 raw: 0000000000000000 0000000000200020 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 0x52820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 15080, tgid 15078 (syz.2.2949), ts 312846800305, free_ts 312588642962 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1af/0x220 mm/page_alloc.c:1845 prep_new_page mm/page_alloc.c:1853 [inline] get_page_from_freelist+0x10a3/0x3a30 mm/page_alloc.c:3879 __alloc_frozen_pages_noprof+0x25f/0x2470 mm/page_alloc.c:5178 alloc_pages_mpol+0x1fb/0x550 mm/mempolicy.c:2416 alloc_slab_page mm/slub.c:3059 [inline] allocate_slab mm/slub.c:3232 [inline] new_slab+0x24a/0x360 mm/slub.c:3286 ___slab_alloc+0xd79/0x1a50 mm/slub.c:4655 __slab_alloc.constprop.0+0x63/0x110 mm/slub.c:4778 __slab_alloc_node mm/slub.c:4854 [inline] slab_alloc_node mm/slub.c:5276 [inline] __do_kmalloc_node mm/slub.c:5649 [inline] __kmalloc_noprof+0x501/0x880 mm/slub.c:5662 kmalloc_noprof include/linux/slab.h:961 [inline] kzalloc_noprof include/linux/slab.h:1094 [inline] hash_netport4_resize+0xf8d/0x1c50 net/netfilter/ipset/ip_set_hash_gen.h:725 call_ad.constprop.0+0x36d/0x940 net/netfilter/ipset/ip_set_core.c:1757 ip_set_ad.constprop.0.isra.0+0x3ce/0x870 net/netfilter/ipset/ip_set_core.c:1841 nfnetlink_rcv_msg+0x9fc/0x1200 net/netfilter/nfnetlink.c:302 netlink_rcv_skb+0x158/0x420 net/netlink/af_netlink.c:2552 nfnetlink_rcv+0x1b3/0x430 net/netfilter/nfnetlink.c:669 netlink_unicast_kernel net/netlink/af_netlink.c:1320 [inline] netlink_unicast+0x5aa/0x870 net/netlink/af_netlink.c:1346 netlink_sendmsg+0x8c8/0xdd0 net/netlink/af_netlink.c:1896 page last free pid 1027 tgid 1027 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1394 [inline] __free_frozen_pages+0x7df/0x1160 mm/page_alloc.c:2901 kasan_depopulate_vmalloc_pte+0x5b/0x80 mm/kasan/shadow.c:495 apply_to_pte_range mm/memory.c:3143 [inline] apply_to_pmd_range mm/memory.c:3187 [inline] apply_to_pud_range mm/memory.c:3223 [inline] apply_to_p4d_range mm/memory.c:3259 [inline] __apply_to_page_range+0xac1/0x13f0 mm/memory.c:3295 kasan_release_vmalloc+0xd1/0xe0 mm/kasan/shadow.c:616 kasan_release_vmalloc_node mm/vmalloc.c:2255 [inline] purge_vmap_node+0x1c4/0xa30 mm/vmalloc.c:2272 __purge_vmap_area_lazy+0xa06/0xc60 mm/vmalloc.c:2362 drain_vmap_area_work+0x27/0x40 mm/vmalloc.c:2396 process_one_work+0x9cf/0x1b70 kernel/workqueue.c:3263 process_scheduled_works kernel/workqueue.c:3346 [inline] worker_thread+0x6c8/0xf10 kernel/workqueue.c:3427 kthread+0x3c5/0x780 kernel/kthread.c:463 ret_from_fork+0x675/0x7d0 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Memory state around the buggy address: ffff8880328a3400: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ffff8880328a3480: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff8880328a3500: 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc ^ ffff8880328a3580: 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc ffff8880328a3600: 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc ==================================================================