mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-26 12:34:41 +08:00
d7442f512b
The CI testing bots triggered the following splat:
[ 718.203054] BUG: KASAN: use-after-free in free_irq_cpu_rmap+0x53/0x80
[ 718.206349] Read of size 4 at addr ffff8881bd127e00 by task sh/20834
[ 718.212852] CPU: 28 PID: 20834 Comm: sh Kdump: loaded Tainted: G S W IOE 5.17.0-rc8_nextqueue-devqueue-02643-g23f3121aca93 #1
[ 718.219695] Hardware name: Intel Corporation S2600WFT/S2600WFT, BIOS SE5C620.86B.02.01.0012.070720200218 07/07/2020
[ 718.223418] Call Trace:
[ 718.227139]
[ 718.230783] dump_stack_lvl+0x33/0x42
[ 718.234431] print_address_description.constprop.9+0x21/0x170
[ 718.238177] ? free_irq_cpu_rmap+0x53/0x80
[ 718.241885] ? free_irq_cpu_rmap+0x53/0x80
[ 718.245539] kasan_report.cold.18+0x7f/0x11b
[ 718.249197] ? free_irq_cpu_rmap+0x53/0x80
[ 718.252852] free_irq_cpu_rmap+0x53/0x80
[ 718.256471] ice_free_cpu_rx_rmap.part.11+0x37/0x50 [ice]
[ 718.260174] ice_remove_arfs+0x5f/0x70 [ice]
[ 718.263810] ice_rebuild_arfs+0x3b/0x70 [ice]
[ 718.267419] ice_rebuild+0x39c/0xb60 [ice]
[ 718.270974] ? asm_sysvec_apic_timer_interrupt+0x12/0x20
[ 718.274472] ? ice_init_phy_user_cfg+0x360/0x360 [ice]
[ 718.278033] ? delay_tsc+0x4a/0xb0
[ 718.281513] ? preempt_count_sub+0x14/0xc0
[ 718.284984] ? delay_tsc+0x8f/0xb0
[ 718.288463] ice_do_reset+0x92/0xf0 [ice]
[ 718.292014] ice_pci_err_resume+0x91/0xf0 [ice]
[ 718.295561] pci_reset_function+0x53/0x80
<...>
[ 718.393035] Allocated by task 690:
[ 718.433497] Freed by task 20834:
[ 718.495688] Last potentially related work creation:
[ 718.568966] The buggy address belongs to the object at ffff8881bd127e00
which belongs to the cache kmalloc-96 of size 96
[ 718.574085] The buggy address is located 0 bytes inside of
96-byte region [ffff8881bd127e00, ffff8881bd127e60)
[ 718.579265] The buggy address belongs to the page:
[ 718.598905] Memory state around the buggy address:
[ 718.601809] ffff8881bd127d00: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
[ 718.604796] ffff8881bd127d80: 00 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc
[ 718.607794] >ffff8881bd127e00: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
[ 718.610811] ^
[ 718.613819] ffff8881bd127e80: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc
[ 718.617107] ffff8881bd127f00: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
This is due to that free_irq_cpu_rmap() is always being called
*after* (devm_)free_irq() and thus it tries to work with IRQ descs
already freed. For example, on device reset the driver frees the
rmap right before allocating a new one (the splat above).
Make rmap creation and freeing function symmetrical with
{request,free}_irq() calls i.e. do that on ifup/ifdown instead
of device probe/remove/resume. These operations can be performed
independently from the actual device aRFS configuration.
Also, make sure ice_vsi_free_irq() clears IRQ affinity notifiers
only when aRFS is disabled -- otherwise, CPU rmap sets and clears
its own and they must not be touched manually.
Fixes:
|
||
---|---|---|
.. | ||
ice_adminq_cmd.h | ||
ice_arfs.c | ||
ice_arfs.h | ||
ice_base.c | ||
ice_base.h | ||
ice_cgu_regs.h | ||
ice_common.c | ||
ice_common.h | ||
ice_controlq.c | ||
ice_controlq.h | ||
ice_dcb_lib.c | ||
ice_dcb_lib.h | ||
ice_dcb_nl.c | ||
ice_dcb_nl.h | ||
ice_dcb.c | ||
ice_dcb.h | ||
ice_devids.h | ||
ice_devlink.c | ||
ice_devlink.h | ||
ice_eswitch.c | ||
ice_eswitch.h | ||
ice_ethtool_fdir.c | ||
ice_ethtool.c | ||
ice_fdir.c | ||
ice_fdir.h | ||
ice_flex_pipe.c | ||
ice_flex_pipe.h | ||
ice_flex_type.h | ||
ice_flow.c | ||
ice_flow.h | ||
ice_fltr.c | ||
ice_fltr.h | ||
ice_fw_update.c | ||
ice_fw_update.h | ||
ice_gnss.c | ||
ice_gnss.h | ||
ice_hw_autogen.h | ||
ice_idc_int.h | ||
ice_idc.c | ||
ice_lag.c | ||
ice_lag.h | ||
ice_lan_tx_rx.h | ||
ice_lib.c | ||
ice_lib.h | ||
ice_main.c | ||
ice_nvm.c | ||
ice_nvm.h | ||
ice_osdep.h | ||
ice_pf_vsi_vlan_ops.c | ||
ice_pf_vsi_vlan_ops.h | ||
ice_protocol_type.h | ||
ice_ptp_consts.h | ||
ice_ptp_hw.c | ||
ice_ptp_hw.h | ||
ice_ptp.c | ||
ice_ptp.h | ||
ice_repr.c | ||
ice_repr.h | ||
ice_sbq_cmd.h | ||
ice_sched.c | ||
ice_sched.h | ||
ice_sriov.c | ||
ice_sriov.h | ||
ice_switch.c | ||
ice_switch.h | ||
ice_tc_lib.c | ||
ice_tc_lib.h | ||
ice_trace.h | ||
ice_txrx_lib.c | ||
ice_txrx_lib.h | ||
ice_txrx.c | ||
ice_txrx.h | ||
ice_type.h | ||
ice_vf_lib_private.h | ||
ice_vf_lib.c | ||
ice_vf_lib.h | ||
ice_vf_mbx.c | ||
ice_vf_mbx.h | ||
ice_vf_vsi_vlan_ops.c | ||
ice_vf_vsi_vlan_ops.h | ||
ice_virtchnl_allowlist.c | ||
ice_virtchnl_allowlist.h | ||
ice_virtchnl_fdir.c | ||
ice_virtchnl_fdir.h | ||
ice_virtchnl.c | ||
ice_virtchnl.h | ||
ice_vlan_mode.c | ||
ice_vlan_mode.h | ||
ice_vlan.h | ||
ice_vsi_vlan_lib.c | ||
ice_vsi_vlan_lib.h | ||
ice_vsi_vlan_ops.c | ||
ice_vsi_vlan_ops.h | ||
ice_xsk.c | ||
ice_xsk.h | ||
ice.h | ||
Makefile |