3
0
Fork 0
forked from mirrors/linux
kernel/drivers/net/ethernet/intel/idpf
Larysa Zaremba ed375b1821 idpf: protect shutdown from reset
Before the referenced commit, the shutdown just called idpf_remove(),
this way IDPF_REMOVE_IN_PROG was protecting us from the serv_task
rescheduling reset. Without this flag set the shutdown process is
vulnerable to HW reset or any other triggering conditions (such as
default mailbox being destroyed).

When one of conditions checked in idpf_service_task becomes true,
vc_event_task can be rescheduled during shutdown, this leads to accessing
freed memory e.g. idpf_req_rel_vector_indexes() trying to read
vport->q_vector_idxs. This in turn causes the system to become defunct
during e.g. systemctl kexec.

Considering using IDPF_REMOVE_IN_PROG would lead to more heavy shutdown
process, instead just cancel the serv_task before cancelling
adapter->serv_task before cancelling adapter->vc_event_task to ensure that
reset will not be scheduled while we are doing a shutdown.

Fixes: 4c9106f490 ("idpf: fix adapter NULL pointer dereference on reboot")
Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Signed-off-by: Larysa Zaremba <larysa.zaremba@intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Reviewed-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Samuel Salin <Samuel.salin@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
2025-04-29 14:28:40 -07:00
..
idpf.h idpf: fix offloads support for encapsulated packets 2025-04-28 15:59:13 -07:00
idpf_controlq.c idpf: add read memory barrier when checking descriptor done bit 2025-01-24 10:03:39 -08:00
idpf_controlq.h
idpf_controlq_api.h
idpf_controlq_setup.c
idpf_dev.c idpf: add support for SW triggered interrupts 2024-12-17 13:28:55 -08:00
idpf_devids.h
idpf_ethtool.c idpf: avoid vport access in idpf_get_link_ksettings 2024-11-04 13:09:33 -08:00
idpf_lan_pf_regs.h
idpf_lan_txrx.h
idpf_lan_vf_regs.h
idpf_lib.c idpf: fix potential memory leak on kcalloc() failure 2025-04-29 14:28:24 -07:00
idpf_main.c idpf: protect shutdown from reset 2025-04-29 14:28:40 -07:00
idpf_mem.h
idpf_singleq_txrx.c libeth: move idpf_rx_csum_decoded and idpf_rx_extracted 2025-02-14 10:58:08 -08:00
idpf_txrx.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2025-02-27 10:20:58 -08:00
idpf_txrx.h idpf: use napi's irq affinity 2025-02-26 19:51:38 -08:00
idpf_vf_dev.c idpf: add support for SW triggered interrupts 2024-12-17 13:28:55 -08:00
idpf_virtchnl.c idpf: add more info during virtchnl transaction timeout/salt mismatch 2025-01-24 10:03:39 -08:00
idpf_virtchnl.h
Kconfig idpf: use libeth Rx buffer management for payload buffer 2024-07-10 10:48:45 -07:00
Makefile idpf: compile singleq code only under default-n CONFIG_IDPF_SINGLEQ 2024-07-10 10:42:26 -07:00
virtchnl2.h
virtchnl2_lan_desc.h