====================================== | [ 12.086753][ T218] ================================================================== | [ 12.087116][ T218] BUG: KASAN: use-after-free in page_pool_item_uninit (net/core/page_pool.c:523) | [ 12.087365][ T218] Read of size 8 at addr ffff888006059008 by task bash/218 | [ 12.087598][ T218] [ 12.087930][ T218] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011 [ 12.088131][ T218] Call Trace: [ 12.088254][ T218] [ 12.088341][ T218] dump_stack_lvl (lib/dump_stack.c:123) [ 12.088509][ T218] print_address_description.constprop.0 (mm/kasan/report.c:379) [ 12.088712][ T218] ? page_pool_item_uninit (net/core/page_pool.c:523) [ 12.088876][ T218] print_report (mm/kasan/report.c:490) [ 12.089037][ T218] ? kasan_addr_to_slab (./include/linux/mm.h:1295 mm/kasan/../slab.h:211 mm/kasan/common.c:38) [ 12.089201][ T218] kasan_report (mm/kasan/report.c:604) [ 12.089325][ T218] ? page_pool_item_uninit (net/core/page_pool.c:523) [ 12.089489][ T218] page_pool_item_uninit (net/core/page_pool.c:523) [ 12.089653][ T218] page_pool_release (net/core/page_pool.c:1431 net/core/page_pool.c:1484) [ 12.089814][ T218] ? __pfx_autoremove_wake_function (kernel/sched/wait.c:383) [ 12.090015][ T218] ? __pfx_page_pool_release (net/core/page_pool.c:1478) [ 12.090179][ T218] ? napi_disable (./arch/x86/include/asm/bitops.h:75 ./include/asm-generic/bitops/instrumented-atomic.h:42 net/core/dev.c:6832) [ 12.090343][ T218] page_pool_destroy (net/core/page_pool.c:1555) [ 12.090505][ T218] nsim_stop (drivers/net/netdevsim/netdev.c:469 drivers/net/netdevsim/netdev.c:483) netdevsim [ 12.090683][ T218] __dev_close_many (net/core/dev.c:1591) [ 12.090843][ T218] ? __pfx___dev_close_many (net/core/dev.c:1555) [ 12.091003][ T218] ? __pfx_validate_chain (kernel/locking/lockdep.c:3860) [ 12.091166][ T218] ? hlock_class (./arch/x86/include/asm/bitops.h:227 ./arch/x86/include/asm/bitops.h:239 ./include/asm-generic/bitops/instrumented-non-atomic.h:142 kernel/locking/lockdep.c:228) [ 12.091324][ T218] ? mark_lock (kernel/locking/lockdep.c:4727 (discriminator 3)) [ 12.091446][ T218] ? hlock_class (./arch/x86/include/asm/bitops.h:227 ./arch/x86/include/asm/bitops.h:239 ./include/asm-generic/bitops/instrumented-non-atomic.h:142 kernel/locking/lockdep.c:228) [ 12.091606][ T218] dev_close_many (net/core/dev.c:1618) [ 12.091768][ T218] ? __pfx_dev_close_many (net/core/dev.c:1608) [ 12.091932][ T218] unregister_netdevice_many_notify (net/core/dev.c:11562) [ 12.092131][ T218] ? __mutex_trylock_common (./arch/x86/include/asm/atomic64_64.h:101 ./include/linux/atomic/atomic-arch-fallback.h:4296 ./include/linux/atomic/atomic-long.h:1482 ./include/linux/atomic/atomic-instrumented.h:4458 kernel/locking/mutex.c:104) [ 12.092295][ T218] ? __pfx___mutex_trylock_common (kernel/locking/mutex.c:79) [ 12.092496][ T218] ? __pfx_unregister_netdevice_many_notify (net/core/dev.c:11529) [ 12.092694][ T218] ? lock_acquire (kernel/locking/lockdep.c:5822) [ 12.092854][ T218] ? __mutex_lock (./arch/x86/include/asm/preempt.h:94 kernel/locking/mutex.c:595 kernel/locking/mutex.c:735) [ 12.093016][ T218] ? nsim_destroy (drivers/net/netdevsim/netdev.c:827) netdevsim [ 12.093188][ T218] ? __pfx___mutex_lock (kernel/locking/mutex.c:734) [ 12.093349][ T218] unregister_netdevice_queue (net/core/dev.c:11524) [ 12.093509][ T218] ? __pfx_do_raw_spin_lock (kernel/locking/spinlock_debug.c:114) [ 12.093675][ T218] ? __pfx_unregister_netdevice_queue (net/core/dev.c:11513) [ 12.093876][ T218] nsim_destroy (drivers/net/netdevsim/netdev.c:832 (discriminator 2)) netdevsim [ 12.094046][ T218] __nsim_dev_port_del (drivers/net/netdevsim/dev.c:426 drivers/net/netdevsim/dev.c:1429) netdevsim [ 12.094254][ T218] nsim_dev_reload_destroy (drivers/net/netdevsim/dev.c:1438 drivers/net/netdevsim/dev.c:1661) netdevsim [ 12.094465][ T218] nsim_drv_remove (drivers/net/netdevsim/dev.c:1678) netdevsim [ 12.094633][ T218] device_release_driver_internal (drivers/base/dd.c:1275 drivers/base/dd.c:1296) [ 12.094834][ T218] ? klist_put (lib/klist.c:220) [ 12.094957][ T218] bus_remove_device (./include/linux/kobject.h:193 drivers/base/base.h:73 drivers/base/bus.c:583) [ 12.095122][ T218] device_del (drivers/base/core.c:3855) [ 12.095245][ T218] ? __pfx_device_del (drivers/base/core.c:3809) [ 12.095404][ T218] ? lock_acquire.part.0 (kernel/locking/lockdep.c:467 kernel/locking/lockdep.c:5851) [ 12.095565][ T218] ? kernfs_fop_write_iter (fs/kernfs/file.c:326) [ 12.095728][ T218] device_unregister (drivers/base/core.c:3772 drivers/base/core.c:3896) [ 12.095887][ T218] del_device_store (drivers/net/netdevsim/bus.c:230) netdevsim [ 12.096094][ T218] ? __pfx_del_device_store (drivers/net/netdevsim/bus.c:197) netdevsim [ 12.096305][ T218] ? __pfx_sysfs_kf_write (fs/sysfs/file.c:132) [ 12.096465][ T218] ? sysfs_file_ops (fs/sysfs/file.c:31 (discriminator 1)) [ 12.096624][ T218] ? __pfx_sysfs_kf_write (fs/sysfs/file.c:132) [ 12.096785][ T218] kernfs_fop_write_iter (fs/kernfs/file.c:334) [ 12.096950][ T218] vfs_write (fs/read_write.c:586 fs/read_write.c:679) [ 12.097073][ T218] ? __pfx_vfs_write (fs/read_write.c:660) [ 12.097233][ T218] ? __lock_release (kernel/locking/lockdep.c:5525) [ 12.097401][ T218] ? do_user_addr_fault (./include/linux/rcupdate.h:347 ./include/linux/rcupdate.h:880 ./include/linux/mm.h:742 arch/x86/mm/fault.c:1340) [ 12.097565][ T218] ? __pfx___up_read (kernel/locking/rwsem.c:1337) [ 12.097725][ T218] ksys_write (fs/read_write.c:731) [ 12.097846][ T218] ? __pfx_ksys_write (fs/read_write.c:721) [ 12.098004][ T218] ? do_user_addr_fault (./include/linux/rcupdate.h:882 ./include/linux/mm.h:742 arch/x86/mm/fault.c:1340) [ 12.098169][ T218] do_syscall_64 (arch/x86/entry/common.c:52 arch/x86/entry/common.c:83) [ 12.098329][ T218] entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:130) [ 12.098528][ T218] RIP: 0033:0x7fd221039b77 [ 12.098695][ T218] Code: 0b 00 f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb b7 0f 1f 00 f3 0f 1e fa 64 8b 04 25 18 00 00 00 85 c0 75 10 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 51 c3 48 83 ec 28 48 89 54 24 18 48 89 74 24 All code ======== 0: 0b 00 or (%rax),%eax 2: f7 d8 neg %eax 4: 64 89 02 mov %eax,%fs:(%rdx) 7: 48 c7 c0 ff ff ff ff mov $0xffffffffffffffff,%rax e: eb b7 jmp 0xffffffffffffffc7 10: 0f 1f 00 nopl (%rax) 13: f3 0f 1e fa endbr64 17: 64 8b 04 25 18 00 00 mov %fs:0x18,%eax 1e: 00 1f: 85 c0 test %eax,%eax 21: 75 10 jne 0x33 23: b8 01 00 00 00 mov $0x1,%eax 28: 0f 05 syscall 2a:* 48 3d 00 f0 ff ff cmp $0xfffffffffffff000,%rax <-- trapping instruction 30: 77 51 ja 0x83 32: c3 ret 33: 48 83 ec 28 sub $0x28,%rsp 37: 48 89 54 24 18 mov %rdx,0x18(%rsp) 3c: 48 rex.W 3d: 89 .byte 0x89 3e: 74 24 je 0x64 Code starting with the faulting instruction =========================================== 0: 48 3d 00 f0 ff ff cmp $0xfffffffffffff000,%rax 6: 77 51 ja 0x59 8: c3 ret 9: 48 83 ec 28 sub $0x28,%rsp d: 48 89 54 24 18 mov %rdx,0x18(%rsp) 12: 48 rex.W 13: 89 .byte 0x89 14: 74 24 je 0x3a [ 12.099254][ T218] RSP: 002b:00007ffd8d328a88 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 [ 12.099494][ T218] RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 00007fd221039b77 [ 12.099733][ T218] RDX: 0000000000000004 RSI: 00005576ced298c0 RDI: 0000000000000001 [ 12.099969][ T218] RBP: 00005576ced298c0 R08: 0000000000000000 R09: 00007fd2210ac4e0 [ 12.100212][ T218] R10: 00007fd2210ac3e0 R11: 0000000000000246 R12: 0000000000000004 [ 12.100450][ T218] R13: 00007fd2210f5760 R14: 0000000000000004 R15: 00007fd2210f09c0 | [ 12.105014][ T218] Disabling lock debugging due to kernel taint | [ 12.105311][ T218] Oops: general protection fault, probably for non-canonical address 0xf99995999999999c: 0000 [#1] PREEMPT SMP KASAN NOPTI | [ 12.105696][ T218] KASAN: maybe wild-memory-access in range [0xcccccccccccccce0-0xcccccccccccccce7] | [ 12.106237][ T218] Tainted: [B]=BAD_PAGE [ 12.106360][ T218] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011 [ 12.106554][ T218] RIP: 0010:page_pool_item_uninit (./arch/x86/include/asm/atomic.h:23 ./include/linux/atomic/atomic-arch-fallback.h:457 ./include/linux/atomic/atomic-instrumented.h:33 ./include/linux/refcount.h:136 net/core/page_pool.c:524) [ 12.106756][ T218] Code: 95 48 bb 00 00 00 00 00 fc ff df 48 c1 ed 03 48 01 dd 4d 8d 75 1c be 04 00 00 00 4c 89 f7 e8 5d bc 68 fe 4c 89 f0 48 c1 e8 03 <0f> b6 14 18 4c 89 f0 83 e0 07 83 c0 03 38 d0 7c 04 84 d2 75 62 41 All code ======== 0: 95 xchg %eax,%ebp 1: 48 bb 00 00 00 00 00 movabs $0xdffffc0000000000,%rbx 8: fc ff df b: 48 c1 ed 03 shr $0x3,%rbp f: 48 01 dd add %rbx,%rbp 12: 4d 8d 75 1c lea 0x1c(%r13),%r14 16: be 04 00 00 00 mov $0x4,%esi 1b: 4c 89 f7 mov %r14,%rdi 1e: e8 5d bc 68 fe call 0xfffffffffe68bc80 23: 4c 89 f0 mov %r14,%rax 26: 48 c1 e8 03 shr $0x3,%rax 2a:* 0f b6 14 18 movzbl (%rax,%rbx,1),%edx <-- trapping instruction 2e: 4c 89 f0 mov %r14,%rax 31: 83 e0 07 and $0x7,%eax 34: 83 c0 03 add $0x3,%eax 37: 38 d0 cmp %dl,%al 39: 7c 04 jl 0x3f 3b: 84 d2 test %dl,%dl 3d: 75 62 jne 0xa1 3f: 41 rex.B Code starting with the faulting instruction =========================================== 0: 0f b6 14 18 movzbl (%rax,%rbx,1),%edx 4: 4c 89 f0 mov %r14,%rax 7: 83 e0 07 and $0x7,%eax a: 83 c0 03 add $0x3,%eax d: 38 d0 cmp %dl,%al f: 7c 04 jl 0x15 11: 84 d2 test %dl,%dl 13: 75 62 jne 0x77 15: 41 rex.B [ 12.107304][ T218] RSP: 0018:ffffc90000a774f0 EFLAGS: 00010a06 [ 12.107513][ T218] RAX: 199999999999999c RBX: dffffc0000000000 RCX: ffffffff93e37b43 [ 12.107744][ T218] RDX: 0000000000000000 RSI: 0000000000000004 RDI: cccccccccccccce0 [ 12.107975][ T218] RBP: fffffbfff2a58878 R08: 0000000000000000 R09: fffffbfff2e19888 [ 12.108207][ T218] R10: ffffffff970cc447 R11: 205d383132542020 R12: ffff888002327220 [ 12.108442][ T218] R13: ccccccccccccccc4 R14: cccccccccccccce0 R15: 0000000000000000 [ 12.108672][ T218] FS: 00007fd220ef8740(0000) GS:ffff88802f500000(0000) knlGS:0000000000000000 [ 12.108942][ T218] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 12.109137][ T218] CR2: 00007fd2210ac733 CR3: 000000000bddc004 CR4: 0000000000772ef0 [ 12.109371][ T218] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 12.109605][ T218] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 12.109836][ T218] PKRU: 55555554 [ 12.109955][ T218] Call Trace: [ 12.110076][ T218] [ 12.110157][ T218] ? die_addr (arch/x86/kernel/dumpstack.c:421 arch/x86/kernel/dumpstack.c:460) [ 12.110280][ T218] ? exc_general_protection (arch/x86/kernel/traps.c:751 arch/x86/kernel/traps.c:693) [ 12.110438][ T218] ? asm_exc_general_protection (./arch/x86/include/asm/idtentry.h:617) [ 12.110600][ T218] ? page_pool_item_uninit (./arch/x86/include/asm/atomic.h:23 ./include/linux/atomic/atomic-arch-fallback.h:457 ./include/linux/atomic/atomic-instrumented.h:33 ./include/linux/refcount.h:136 net/core/page_pool.c:524) [ 12.110756][ T218] ? page_pool_item_uninit (./arch/x86/include/asm/atomic.h:23 ./include/linux/atomic/atomic-arch-fallback.h:457 ./include/linux/atomic/atomic-instrumented.h:33 ./include/linux/refcount.h:136 net/core/page_pool.c:524) [ 12.110912][ T218] page_pool_release (net/core/page_pool.c:1431 net/core/page_pool.c:1484) [ 12.111070][ T218] ? __pfx_autoremove_wake_function (kernel/sched/wait.c:383) [ 12.111263][ T218] ? __pfx_page_pool_release (net/core/page_pool.c:1478) [ 12.111419][ T218] ? napi_disable (./arch/x86/include/asm/bitops.h:75 ./include/asm-generic/bitops/instrumented-atomic.h:42 net/core/dev.c:6832) [ 12.111578][ T218] page_pool_destroy (net/core/page_pool.c:1555) [ 12.111733][ T218] nsim_stop (drivers/net/netdevsim/netdev.c:469 drivers/net/netdevsim/netdev.c:483) netdevsim [ 12.111900][ T218] __dev_close_many (net/core/dev.c:1591) [ 12.112054][ T218] ? __pfx___dev_close_many (net/core/dev.c:1555) [ 12.112216][ T218] ? __pfx_validate_chain (kernel/locking/lockdep.c:3860) [ 12.112371][ T218] ? hlock_class (./arch/x86/include/asm/bitops.h:227 ./arch/x86/include/asm/bitops.h:239 ./include/asm-generic/bitops/instrumented-non-atomic.h:142 kernel/locking/lockdep.c:228) [ 12.112527][ T218] ? mark_lock (kernel/locking/lockdep.c:4727 (discriminator 3)) [ 12.112644][ T218] ? hlock_class (./arch/x86/include/asm/bitops.h:227 ./arch/x86/include/asm/bitops.h:239 ./include/asm-generic/bitops/instrumented-non-atomic.h:142 kernel/locking/lockdep.c:228) [ 12.112802][ T218] dev_close_many (net/core/dev.c:1618) [ 12.112957][ T218] ? __pfx_dev_close_many (net/core/dev.c:1608) [ 12.113116][ T218] unregister_netdevice_many_notify (net/core/dev.c:11562) [ 12.113307][ T218] ? __mutex_trylock_common (./arch/x86/include/asm/atomic64_64.h:101 ./include/linux/atomic/atomic-arch-fallback.h:4296 ./include/linux/atomic/atomic-long.h:1482 ./include/linux/atomic/atomic-instrumented.h:4458 kernel/locking/mutex.c:104) [ 12.113464][ T218] ? __pfx___mutex_trylock_common (kernel/locking/mutex.c:79) [ 12.113656][ T218] ? __pfx_unregister_netdevice_many_notify (net/core/dev.c:11529) [ 12.113854][ T218] ? lock_acquire (kernel/locking/lockdep.c:5822) [ 12.114009][ T218] ? __mutex_lock (./arch/x86/include/asm/preempt.h:94 kernel/locking/mutex.c:595 kernel/locking/mutex.c:735) [ 12.114164][ T218] ? nsim_destroy (drivers/net/netdevsim/netdev.c:827) netdevsim [ 12.114328][ T218] ? __pfx___mutex_lock (kernel/locking/mutex.c:734) [ 12.114484][ T218] unregister_netdevice_queue (net/core/dev.c:11524) [ 12.114638][ T218] ? __pfx_do_raw_spin_lock (kernel/locking/spinlock_debug.c:114) [ 12.114792][ T218] ? __pfx_unregister_netdevice_queue (net/core/dev.c:11513) [ 12.114988][ T218] nsim_destroy (drivers/net/netdevsim/netdev.c:832 (discriminator 2)) netdevsim [ 12.115155][ T218] __nsim_dev_port_del (drivers/net/netdevsim/dev.c:426 drivers/net/netdevsim/dev.c:1429) netdevsim [ 12.115355][ T218] nsim_dev_reload_destroy (drivers/net/netdevsim/dev.c:1438 drivers/net/netdevsim/dev.c:1661) netdevsim [ 12.115555][ T218] nsim_drv_remove (drivers/net/netdevsim/dev.c:1678) netdevsim [ 12.115721][ T218] device_release_driver_internal (drivers/base/dd.c:1275 drivers/base/dd.c:1296) [ 12.115913][ T218] ? klist_put (lib/klist.c:220) [ 12.116032][ T218] bus_remove_device (./include/linux/kobject.h:193 drivers/base/base.h:73 drivers/base/bus.c:583) [ 12.116189][ T218] device_del (drivers/base/core.c:3855) [ 12.116310][ T218] ? __pfx_device_del (drivers/base/core.c:3809) [ 12.116464][ T218] ? lock_acquire.part.0 (kernel/locking/lockdep.c:467 kernel/locking/lockdep.c:5851) [ 12.116619][ T218] ? kernfs_fop_write_iter (fs/kernfs/file.c:326) [ 12.116775][ T218] device_unregister (drivers/base/core.c:3772 drivers/base/core.c:3896) [ 12.116931][ T218] del_device_store (drivers/net/netdevsim/bus.c:230) netdevsim [ 12.117133][ T218] ? __pfx_del_device_store (drivers/net/netdevsim/bus.c:197) netdevsim [ 12.117354][ T218] ? __pfx_sysfs_kf_write (fs/sysfs/file.c:132) [ 12.117510][ T218] ? sysfs_file_ops (fs/sysfs/file.c:31 (discriminator 1)) [ 12.117665][ T218] ? __pfx_sysfs_kf_write (fs/sysfs/file.c:132) [ 12.117820][ T218] kernfs_fop_write_iter (fs/kernfs/file.c:334) [ 12.117976][ T218] vfs_write (fs/read_write.c:586 fs/read_write.c:679) [ 12.118096][ T218] ? __pfx_vfs_write (fs/read_write.c:660) [ 12.118251][ T218] ? __lock_release (kernel/locking/lockdep.c:5525) [ 12.118408][ T218] ? do_user_addr_fault (./include/linux/rcupdate.h:347 ./include/linux/rcupdate.h:880 ./include/linux/mm.h:742 arch/x86/mm/fault.c:1340) [ 12.118565][ T218] ? __pfx___up_read (kernel/locking/rwsem.c:1337) [ 12.118722][ T218] ksys_write (fs/read_write.c:731) [ 12.118840][ T218] ? __pfx_ksys_write (fs/read_write.c:721) [ 12.118992][ T218] ? do_user_addr_fault (./include/linux/rcupdate.h:882 ./include/linux/mm.h:742 arch/x86/mm/fault.c:1340) [ 12.119151][ T218] do_syscall_64 (arch/x86/entry/common.c:52 arch/x86/entry/common.c:83) [ 12.119306][ T218] entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:130) [ 12.119501][ T218] RIP: 0033:0x7fd221039b77 [ 12.119659][ T218] Code: 0b 00 f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb b7 0f 1f 00 f3 0f 1e fa 64 8b 04 25 18 00 00 00 85 c0 75 10 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 51 c3 48 83 ec 28 48 89 54 24 18 48 89 74 24 All code ======== 0: 0b 00 or (%rax),%eax 2: f7 d8 neg %eax 4: 64 89 02 mov %eax,%fs:(%rdx) 7: 48 c7 c0 ff ff ff ff mov $0xffffffffffffffff,%rax e: eb b7 jmp 0xffffffffffffffc7 10: 0f 1f 00 nopl (%rax) 13: f3 0f 1e fa endbr64 17: 64 8b 04 25 18 00 00 mov %fs:0x18,%eax 1e: 00 1f: 85 c0 test %eax,%eax 21: 75 10 jne 0x33 23: b8 01 00 00 00 mov $0x1,%eax 28: 0f 05 syscall 2a:* 48 3d 00 f0 ff ff cmp $0xfffffffffffff000,%rax <-- trapping instruction 30: 77 51 ja 0x83 32: c3 ret 33: 48 83 ec 28 sub $0x28,%rsp 37: 48 89 54 24 18 mov %rdx,0x18(%rsp) 3c: 48 rex.W 3d: 89 .byte 0x89 3e: 74 24 je 0x64 Code starting with the faulting instruction =========================================== 0: 48 3d 00 f0 ff ff cmp $0xfffffffffffff000,%rax 6: 77 51 ja 0x59 8: c3 ret 9: 48 83 ec 28 sub $0x28,%rsp d: 48 89 54 24 18 mov %rdx,0x18(%rsp) 12: 48 rex.W 13: 89 .byte 0x89 14: 74 24 je 0x3a [ 12.120201][ T218] RSP: 002b:00007ffd8d328a88 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 [ 12.120434][ T218] RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 00007fd221039b77 [ 12.120671][ T218] RDX: 0000000000000004 RSI: 00005576ced298c0 RDI: 0000000000000001 [ 12.120903][ T218] RBP: 00005576ced298c0 R08: 0000000000000000 R09: 00007fd2210ac4e0 [ 12.121134][ T218] R10: 00007fd2210ac3e0 R11: 0000000000000246 R12: 0000000000000004 Finger prints: print_report:kasan_report:page_pool_item_uninit:page_pool_release:page_pool_destroy page_pool_item_uninit:page_pool_release:page_pool_destroy:nsim_stop:__dev_close_many