1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/drivers/net/ethernet/intel/ice
Przemyslaw Patynowski efe4186000 ice: Fix memory corruption in VF driver
Disable VF's RX/TX queues, when it's disabled. VF can have queues enabled,
when it requests a reset. If PF driver assumes that VF is disabled,
while VF still has queues configured, VF may unmap DMA resources.
In such scenario device still can map packets to memory, which ends up
silently corrupting it.
Previously, VF driver could experience memory corruption, which lead to
crash:
[ 5119.170157] BUG: unable to handle kernel paging request at 00001b9780003237
[ 5119.170166] PGD 0 P4D 0
[ 5119.170173] Oops: 0002 [#1] PREEMPT_RT SMP PTI
[ 5119.170181] CPU: 30 PID: 427592 Comm: kworker/u96:2 Kdump: loaded Tainted: G        W I      --------- -  - 4.18.0-372.9.1.rt7.166.el8.x86_64 #1
[ 5119.170189] Hardware name: Dell Inc. PowerEdge R740/014X06, BIOS 2.3.10 08/15/2019
[ 5119.170193] Workqueue: iavf iavf_adminq_task [iavf]
[ 5119.170219] RIP: 0010:__page_frag_cache_drain+0x5/0x30
[ 5119.170238] Code: 0f 0f b6 77 51 85 f6 74 07 31 d2 e9 05 df ff ff e9 90 fe ff ff 48 8b 05 49 db 33 01 eb b4 0f 1f 80 00 00 00 00 0f 1f 44 00 00 <f0> 29 77 34 74 01 c3 48 8b 07 f6 c4 80 74 0f 0f b6 77 51 85 f6 74
[ 5119.170244] RSP: 0018:ffffa43b0bdcfd78 EFLAGS: 00010282
[ 5119.170250] RAX: ffffffff896b3e40 RBX: ffff8fb282524000 RCX: 0000000000000002
[ 5119.170254] RDX: 0000000049000000 RSI: 0000000000000000 RDI: 00001b9780003203
[ 5119.170259] RBP: ffff8fb248217b00 R08: 0000000000000022 R09: 0000000000000009
[ 5119.170262] R10: 2b849d6300000000 R11: 0000000000000020 R12: 0000000000000000
[ 5119.170265] R13: 0000000000001000 R14: 0000000000000009 R15: 0000000000000000
[ 5119.170269] FS:  0000000000000000(0000) GS:ffff8fb1201c0000(0000) knlGS:0000000000000000
[ 5119.170274] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 5119.170279] CR2: 00001b9780003237 CR3: 00000008f3e1a003 CR4: 00000000007726e0
[ 5119.170283] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 5119.170286] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[ 5119.170290] PKRU: 55555554
[ 5119.170292] Call Trace:
[ 5119.170298]  iavf_clean_rx_ring+0xad/0x110 [iavf]
[ 5119.170324]  iavf_free_rx_resources+0xe/0x50 [iavf]
[ 5119.170342]  iavf_free_all_rx_resources.part.51+0x30/0x40 [iavf]
[ 5119.170358]  iavf_virtchnl_completion+0xd8a/0x15b0 [iavf]
[ 5119.170377]  ? iavf_clean_arq_element+0x210/0x280 [iavf]
[ 5119.170397]  iavf_adminq_task+0x126/0x2e0 [iavf]
[ 5119.170416]  process_one_work+0x18f/0x420
[ 5119.170429]  worker_thread+0x30/0x370
[ 5119.170437]  ? process_one_work+0x420/0x420
[ 5119.170445]  kthread+0x151/0x170
[ 5119.170452]  ? set_kthread_struct+0x40/0x40
[ 5119.170460]  ret_from_fork+0x35/0x40
[ 5119.170477] Modules linked in: iavf sctp ip6_udp_tunnel udp_tunnel mlx4_en mlx4_core nfp tls vhost_net vhost vhost_iotlb tap tun xt_CHECKSUM ipt_MASQUERADE xt_conntrack ipt_REJECT nf_reject_ipv4 nft_compat nft_counter nft_chain_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 nf_tables nfnetlink bridge stp llc rpcsec_gss_krb5 auth_rpcgss nfsv4 dns_resolver nfs lockd grace fscache sunrpc intel_rapl_msr iTCO_wdt iTCO_vendor_support dell_smbios wmi_bmof dell_wmi_descriptor dcdbas kvm_intel kvm irqbypass intel_rapl_common isst_if_common skx_edac irdma nfit libnvdimm x86_pkg_temp_thermal i40e intel_powerclamp coretemp crct10dif_pclmul crc32_pclmul ghash_clmulni_intel ib_uverbs rapl ipmi_ssif intel_cstate intel_uncore mei_me pcspkr acpi_ipmi ib_core mei lpc_ich i2c_i801 ipmi_si ipmi_devintf wmi ipmi_msghandler acpi_power_meter xfs libcrc32c sd_mod t10_pi sg mgag200 drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops ice ahci drm libahci crc32c_intel libata tg3 megaraid_sas
[ 5119.170613]  i2c_algo_bit dm_mirror dm_region_hash dm_log dm_mod fuse [last unloaded: iavf]
[ 5119.170627] CR2: 00001b9780003237

Fixes: ec4f5a436b ("ice: Check if VF is disabled for Opcode and other operations")
Signed-off-by: Przemyslaw Patynowski <przemyslawx.patynowski@intel.com>
Co-developed-by: Slawomir Laba <slawomirx.laba@intel.com>
Signed-off-by: Slawomir Laba <slawomirx.laba@intel.com>
Signed-off-by: Mateusz Palczewski <mateusz.palczewski@intel.com>
Tested-by: Konrad Jankowski <konrad0.jankowski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
2022-06-14 09:38:57 -07:00
..
ice.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-05-12 16:15:30 -07:00
ice_adminq_cmd.h ice: fix access-beyond-end in the switch code 2022-06-02 12:41:10 +02:00
ice_arfs.c ice: arfs: fix use-after-free when freeing @rx_cpu_rmap 2022-04-08 09:08:36 -07:00
ice_arfs.h ice: remove circular header dependencies on ice.h 2022-03-14 17:22:58 -07:00
ice_base.c ice: rename ice_virtchnl_pf.c to ice_sriov.c 2022-03-14 17:22:58 -07:00
ice_base.h ice: split ice_ring onto Tx/Rx separate structs 2021-10-15 07:39:02 -07:00
ice_cgu_regs.h ice: ensure the hardware Clock Generation Unit is configured 2021-12-21 09:11:40 -08:00
ice_common.c ice: add TTY for GNSS module for E810T device 2022-03-03 14:11:00 +00:00
ice_common.h ice: remove circular header dependencies on ice.h 2022-03-14 17:22:58 -07:00
ice_controlq.c ice: Cleanup after ice_status removal 2021-12-14 10:19:13 -08:00
ice_controlq.h ice: add support for sideband messages 2021-06-11 07:38:00 -07:00
ice_dcb.c ice: Cleanup after ice_status removal 2021-12-14 10:19:13 -08:00
ice_dcb.h ice: remove circular header dependencies on ice.h 2022-03-14 17:22:58 -07:00
ice_dcb_lib.c ice: Add hot path support for 802.1Q and 802.1ad VLAN offloads 2022-02-09 09:24:45 -08:00
ice_dcb_lib.h ice: Add infrastructure for mqprio support via ndo_setup_tc 2021-10-20 15:57:54 -07:00
ice_dcb_nl.c ice: Fix problems with DSCP QoS implementation 2021-12-07 13:21:01 -08:00
ice_dcb_nl.h ice: use static inline for dummy functions 2021-06-07 08:59:01 -07:00
ice_devids.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-10-22 11:41:16 +01:00
ice_devlink.c ice: always check VF VSI pointer values 2022-05-05 11:28:36 -07:00
ice_devlink.h net/ice: Remove unused enum 2021-11-30 08:02:12 -08:00
ice_eswitch.c ice: fix crash in switchdev mode 2022-04-14 08:19:54 -07:00
ice_eswitch.h ice: allow creating VFs for !CONFIG_NET_SWITCHDEV 2022-04-14 08:19:54 -07:00
ice_ethtool.c ice: Expose RSS indirection tables for queue groups via ethtool 2022-05-13 17:05:49 -07:00
ice_ethtool_fdir.c ice: Add flow director support for channel mode 2021-12-30 13:16:07 +00:00
ice_fdir.c ice: Cleanup after ice_status removal 2021-12-14 10:19:13 -08:00
ice_fdir.h ice: Add flow director support for channel mode 2021-12-30 13:16:07 +00:00
ice_flex_pipe.c ice: remove circular header dependencies on ice.h 2022-03-14 17:22:58 -07:00
ice_flex_pipe.h ice: Fix FV offset searching 2022-03-11 08:28:27 -08:00
ice_flex_type.h ice: Support GTP-U and GTP-C offload in switchdev 2022-03-11 08:28:28 -08:00
ice_flow.c ice: remove circular header dependencies on ice.h 2022-03-14 17:22:58 -07:00
ice_flow.h ice: remove circular header dependencies on ice.h 2022-03-14 17:22:58 -07:00
ice_fltr.c ice: Fix broken IFF_ALLMULTI handling 2022-04-01 12:01:38 +01:00
ice_fltr.h ice: Introduce ice_vlan struct 2022-02-09 09:24:45 -08:00
ice_fw_update.c ice: support immediate firmware activation via devlink reload 2021-12-15 08:40:38 -08:00
ice_fw_update.h ice: support immediate firmware activation via devlink reload 2021-12-15 08:40:38 -08:00
ice_gnss.c ice: use min_t() to make code cleaner in ice_gnss 2022-05-05 11:28:35 -07:00
ice_gnss.h ice: add TTY for GNSS module for E810T device 2022-03-03 14:11:00 +00:00
ice_hw_autogen.h ice: support crosstimestamping on E822 devices if supported 2021-12-21 09:11:40 -08:00
ice_idc.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-05-12 16:15:30 -07:00
ice_idc_int.h ice: remove circular header dependencies on ice.h 2022-03-14 17:22:58 -07:00
ice_lag.c ice: Fix KASAN error in LAG NETDEV_UNREGISTER handler 2022-02-10 08:47:26 -08:00
ice_lag.h ice: Add initial support framework for LAG 2021-02-08 16:27:01 -08:00
ice_lan_tx_rx.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-02-10 17:29:56 -08:00
ice_lib.c ice: Fix interrupt moderation settings getting cleared 2022-05-17 10:37:09 -07:00
ice_lib.h ice: store VF pointer instead of VF ID 2022-03-03 08:46:47 -08:00
ice_main.c ice: Sync VLAN filtering features for DVM 2022-06-14 09:38:57 -07:00
ice_nvm.c ice: Fix memory leak in ice_get_orom_civd_data() 2022-04-14 08:31:01 -07:00
ice_nvm.h ice: support immediate firmware activation via devlink reload 2021-12-15 08:40:38 -08:00
ice_osdep.h ice: remove circular header dependencies on ice.h 2022-03-14 17:22:58 -07:00
ice_pf_vsi_vlan_ops.c ice: Support configuring the device to Double VLAN Mode 2022-02-09 09:24:45 -08:00
ice_pf_vsi_vlan_ops.h ice: Add outer_vlan_ops and VSI specific VLAN ops implementations 2022-02-09 09:24:45 -08:00
ice_protocol_type.h ice: Support GTP-U and GTP-C offload in switchdev 2022-03-11 08:28:28 -08:00
ice_ptp.c ice: Fix PTP TX timestamp offset calculation 2022-06-14 09:35:57 -07:00
ice_ptp.h ice: Fix PTP TX timestamp offset calculation 2022-06-14 09:35:57 -07:00
ice_ptp_consts.h ice: ensure the hardware Clock Generation Unit is configured 2021-12-21 09:11:40 -08:00
ice_ptp_hw.c ice: add TTY for GNSS module for E810T device 2022-03-03 14:11:00 +00:00
ice_ptp_hw.h ice: add TTY for GNSS module for E810T device 2022-03-03 14:11:00 +00:00
ice_repr.c ice: link representors to PCI device 2022-05-06 09:43:01 -07:00
ice_repr.h ice: remove circular header dependencies on ice.h 2022-03-14 17:22:58 -07:00
ice_sbq_cmd.h ice: add support for sideband messages 2021-06-11 07:38:00 -07:00
ice_sched.c ice: Remove unnecessary casts 2021-12-14 10:19:14 -08:00
ice_sched.h ice: Cleanup after ice_status removal 2021-12-14 10:19:13 -08:00
ice_sriov.c ice: always check VF VSI pointer values 2022-05-05 11:28:36 -07:00
ice_sriov.h ice: introduce ice_virtchnl.c and ice_virtchnl.h 2022-03-15 13:23:10 -07:00
ice_switch.c ice: fix access-beyond-end in the switch code 2022-06-02 12:41:10 +02:00
ice_switch.h ice: fix access-beyond-end in the switch code 2022-06-02 12:41:10 +02:00
ice_tc_lib.c ice: return ENOSPC when exceeding ICE_MAX_CHAIN_WORDS 2022-05-05 11:28:35 -07:00
ice_tc_lib.h ice: Support GTP-U and GTP-C offload in switchdev 2022-03-11 08:28:28 -08:00
ice_trace.h ice: add trace events for tx timestamps 2022-03-16 10:38:15 -07:00
ice_txrx.c ice: Add mpls+tso support 2022-04-12 11:05:09 -07:00
ice_txrx.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-05-19 11:23:59 -07:00
ice_txrx_lib.c Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue 2022-02-10 11:00:13 +00:00
ice_txrx_lib.h ice: Add hot path support for 802.1Q and 802.1ad VLAN offloads 2022-02-09 09:24:45 -08:00
ice_type.h ice: remove circular header dependencies on ice.h 2022-03-14 17:22:58 -07:00
ice_vf_lib.c ice: Fix memory corruption in VF driver 2022-06-14 09:38:57 -07:00
ice_vf_lib.h ice: remove period on argument description in ice_for_each_vf 2022-05-05 11:28:36 -07:00
ice_vf_lib_private.h ice: remove PF pointer from ice_check_vf_init 2022-03-15 13:23:14 -07:00
ice_vf_mbx.c ice: rename ice_sriov.c to ice_vf_mbx.c 2022-03-14 17:22:58 -07:00
ice_vf_mbx.h ice: rename ice_sriov.c to ice_vf_mbx.c 2022-03-14 17:22:58 -07:00
ice_vf_vsi_vlan_ops.c ice: rename ice_virtchnl_pf.c to ice_sriov.c 2022-03-14 17:22:58 -07:00
ice_vf_vsi_vlan_ops.h ice: Add support for VIRTCHNL_VF_OFFLOAD_VLAN_V2 2022-02-09 09:24:45 -08:00
ice_virtchnl.c ice: Fix queue config fail handling 2022-06-14 09:38:57 -07:00
ice_virtchnl.h ice: introduce ice_virtchnl.c and ice_virtchnl.h 2022-03-15 13:23:10 -07:00
ice_virtchnl_allowlist.c ice: Add support for VIRTCHNL_VF_OFFLOAD_VLAN_V2 2022-02-09 09:24:45 -08:00
ice_virtchnl_allowlist.h ice: Allow ignoring opcodes on specific VF 2021-04-22 09:26:22 -07:00
ice_virtchnl_fdir.c ice: always check VF VSI pointer values 2022-05-05 11:28:36 -07:00
ice_virtchnl_fdir.h ice: introduce ice_vf_lib.c, ice_vf_lib.h, and ice_vf_lib_private.h 2022-03-15 13:22:13 -07:00
ice_vlan.h ice: Use the proto argument for VLAN ops 2022-02-09 09:24:45 -08:00
ice_vlan_mode.c ice: Support configuring the device to Double VLAN Mode 2022-02-09 09:24:45 -08:00
ice_vlan_mode.h ice: Support configuring the device to Double VLAN Mode 2022-02-09 09:24:45 -08:00
ice_vsi_vlan_lib.c ice: Support configuring the device to Double VLAN Mode 2022-02-09 09:24:45 -08:00
ice_vsi_vlan_lib.h ice: Add outer_vlan_ops and VSI specific VLAN ops implementations 2022-02-09 09:24:45 -08:00
ice_vsi_vlan_ops.c ice: Add outer_vlan_ops and VSI specific VLAN ops implementations 2022-02-09 09:24:45 -08:00
ice_vsi_vlan_ops.h ice: Support configuring the device to Double VLAN Mode 2022-02-09 09:24:45 -08:00
ice_xsk.c Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2022-04-27 17:09:32 -07:00
ice_xsk.h ice: remove circular header dependencies on ice.h 2022-03-14 17:22:58 -07:00
Makefile ice: fix access-beyond-end in the switch code 2022-06-02 12:41:10 +02:00