em28xx 7-1:0.132: Closing video extension em28xx 7-1:0.132: Closing input extension ================================================================== B BUG: KASAN: slab-use-after-free in media_device_unregister drivers/media/mc/mc-device.c:833 [inline] BUG: KASAN: slab-use-after-free in media_device_unregister+0x59d/0x610 drivers/media/mc/mc-device.c:811 Read of size 8 at addr ffff888025438208 by task kworker/2:3/5964 CPU: 2 UID: 0 PID: 5964 Comm: kworker/2:3 Not tainted syzkaller #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 Workqueue: usb_hub_wq hub_event Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0x13d/0x4b0 mm/kasan/report.c:482 kasan_report+0xdf/0x1c0 mm/kasan/report.c:595 media_device_unregister drivers/media/mc/mc-device.c:833 [inline] media_device_unregister+0x59d/0x610 drivers/media/mc/mc-device.c:811 em28xx_unregister_media_device+0x4e/0xe0 drivers/media/usb/em28xx/em28xx-cards.c:3777 em28xx_release_resources+0x79/0x1b0 drivers/media/usb/em28xx/em28xx-cards.c:3798 em28xx_usb_disconnect.cold+0x17d/0x253 drivers/media/usb/em28xx/em28xx-cards.c:4492 usb_unbind_interface+0x1dd/0x9b0 drivers/usb/core/driver.c:460 device_remove drivers/base/dd.c:619 [inline] device_remove+0x12a/0x180 drivers/base/dd.c:611 __device_release_driver drivers/base/dd.c:1357 [inline] device_release_driver_internal+0x441/0x610 drivers/base/dd.c:1380 bus_remove_device+0x2bc/0x560 drivers/base/bus.c:678 device_del+0x376/0x9b0 drivers/base/core.c:3967 usb_disable_device+0x367/0x810 drivers/usb/core/message.c:1484 usb_disconnect+0x2e2/0x9a0 drivers/usb/core/hub.c:2355 hub_port_connect drivers/usb/core/hub.c:5425 [inline] hub_port_connect_change drivers/usb/core/hub.c:5725 [inline] port_event drivers/usb/core/hub.c:5889 [inline] hub_event+0x1bb1/0x4420 drivers/usb/core/hub.c:5971 process_one_work+0xac7/0x1b10 kernel/workqueue.c:3495 process_scheduled_works kernel/workqueue.c:3578 [inline] worker_thread+0x5ef/0xe50 kernel/workqueue.c:3659 kthread+0x373/0x450 kernel/kthread.c:436 ret_from_fork+0x730/0xd60 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Allocated by task 25: kasan_save_stack+0x30/0x50 mm/kasan/common.c:57 kasan_save_track+0x14/0x40 mm/kasan/common.c:79 poison_kmalloc_redzone mm/kasan/common.c:412 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:429 kasan_kmalloc include/linux/kasan.h:267 [inline] __kmalloc_cache_noprof+0x2f8/0x6d0 mm/slub.c:5680 _kmalloc_noprof include/linux/slab.h:991 [inline] _kzalloc_noprof include/linux/slab.h:1312 [inline] em28xx_v4l2_init.cold+0x94/0x3a7f drivers/media/usb/em28xx/em28xx-video.c:2751 em28xx_init_extension+0x13a/0x200 drivers/media/usb/em28xx/em28xx-core.c:1245 request_module_async+0x1e/0x30 drivers/media/usb/em28xx/em28xx-cards.c:3723 process_one_work+0xac7/0x1b10 kernel/workqueue.c:3495 process_scheduled_works kernel/workqueue.c:3578 [inline] worker_thread+0x5ef/0xe50 kernel/workqueue.c:3659 kthread+0x373/0x450 kernel/kthread.c:436 ret_from_fork+0x730/0xd60 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Freed by task 5964: kasan_save_stack+0x30/0x50 mm/kasan/common.c:57 kasan_save_track+0x14/0x40 mm/kasan/common.c:79 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:599 poison_slab_object mm/kasan/common.c:267 [inline] __kasan_slab_free+0x73/0x90 mm/kasan/common.c:299 kasan_slab_free include/linux/kasan.h:239 [inline] slab_free_hook mm/slub.c:2780 [inline] slab_free mm/slub.c:6637 [inline] kfree+0x22d/0x6d0 mm/slub.c:6930 em28xx_free_v4l2+0x7b/0x110 drivers/media/usb/em28xx/em28xx-video.c:2337 v4l2_device_release drivers/media/v4l2-core/v4l2-device.c:51 [inline] kref_put include/linux/kref.h:65 [inline] v4l2_device_put+0xa3/0xd0 drivers/media/v4l2-core/v4l2-device.c:56 em28xx_v4l2_fini.cold+0x267/0x312 drivers/media/usb/em28xx/em28xx-video.c:2465 em28xx_close_extension+0xd2/0x460 drivers/media/usb/em28xx/em28xx-core.c:1262 em28xx_usb_disconnect.cold+0x13d/0x253 drivers/media/usb/em28xx/em28xx-cards.c:4488 usb_unbind_interface+0x1dd/0x9b0 drivers/usb/core/driver.c:460 device_remove drivers/base/dd.c:619 [inline] device_remove+0x12a/0x180 drivers/base/dd.c:611 __device_release_driver drivers/base/dd.c:1357 [inline] device_release_driver_internal+0x441/0x610 drivers/base/dd.c:1380 bus_remove_device+0x2bc/0x560 drivers/base/bus.c:678 device_del+0x376/0x9b0 drivers/base/core.c:3967 usb_disable_device+0x367/0x810 drivers/usb/core/message.c:1484 usb_disconnect+0x2e2/0x9a0 drivers/usb/core/hub.c:2355 hub_port_connect drivers/usb/core/hub.c:5425 [inline] hub_port_connect_change drivers/usb/core/hub.c:5725 [inline] port_event drivers/usb/core/hub.c:5889 [inline] hub_event+0x1bb1/0x4420 drivers/usb/core/hub.c:5971 process_one_work+0xac7/0x1b10 kernel/workqueue.c:3495 process_scheduled_works kernel/workqueue.c:3578 [inline] worker_thread+0x5ef/0xe50 kernel/workqueue.c:3659 kthread+0x373/0x450 kernel/kthread.c:436 ret_from_fork+0x730/0xd60 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 ffff888025438000 which belongs to the cache kmalloc-8k of size 8192 The buggy address is located 520 bytes inside of freed 8192-byte region [ffff888025438000, ffff88802543a000) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x25438 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000040 ffff88801d443180 dead000000000100 dead000000000122 raw: 0000000000000000 0000000000020002 00000000f5000000 0000000000000000 head: 00fff00000000040 ffff88801d443180 dead000000000100 dead000000000122 head: 0000000000000000 0000000000020002 00000000f5000000 0000000000000000 head: 00fff00000000003 fffffffffffffe01 00000000ffffffff 00000000ffffffff head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000008 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 1, tgid 1 (swapper/0), ts 4501101629 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0xfd/0x120 mm/page_alloc.c:1873 prep_new_page mm/page_alloc.c:1881 [inline] get_page_from_freelist+0xdae/0x2c80 mm/page_alloc.c:3963 __alloc_frozen_pages_noprof+0x2ad/0x31e0 mm/page_alloc.c:5505 alloc_slab_page mm/slub.c:3384 [inline] allocate_slab mm/slub.c:3499 [inline] new_slab+0xb1/0x6d0 mm/slub.c:3550 refill_objects+0xe3/0x410 mm/slub.c:7546 refill_sheaf mm/slub.c:2917 [inline] __pcs_replace_empty_main+0x35e/0x650 mm/slub.c:4811 alloc_from_pcs mm/slub.c:4887 [inline] slab_alloc_node mm/slub.c:5021 [inline] __do_kmalloc_node mm/slub.c:5530 [inline] __kmalloc_noprof+0x677/0x840 mm/slub.c:5556 _kmalloc_noprof include/linux/slab.h:995 [inline] acpi_ut_initialize_buffer+0x144/0x220 drivers/acpi/acpica/utalloc.c:327 acpi_rs_create_pci_routing_table+0x135/0xe00 drivers/acpi/acpica/rscreate.c:212 acpi_rs_get_prt_method_data+0xc1/0x150 drivers/acpi/acpica/rsutils.c:456 acpi_get_irq_routing_table+0xb8/0x140 drivers/acpi/acpica/rsxface.c:137 acpi_pci_irq_find_prt_entry+0x178/0xdd0 drivers/acpi/pci_irq.c:215 acpi_pci_irq_lookup+0x8e/0x6b0 drivers/acpi/pci_irq.c:299 acpi_pci_irq_disable+0x1a8/0x360 drivers/acpi/pci_irq.c:499 pcibios_disable_device arch/x86/pci/common.c:706 [inline] pcibios_disable_device+0x89/0xb0 arch/x86/pci/common.c:703 do_pci_disable_device+0x9f/0x100 drivers/pci/pci.c:2228 page_owner free stack trace missing Memory state around the buggy address: ffff888025438100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888025438180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888025438200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888025438280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888025438300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================