]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
idpf: fix memory leak of flow steer list on rmmod
authorSreedevi Joshi <sreedevi.joshi@intel.com>
Tue, 30 Sep 2025 21:23:51 +0000 (16:23 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 17 Jan 2026 15:35:27 +0000 (16:35 +0100)
commit1aedff70a5e97628eaaf17b169774cb6a45a1dc5
treef742d3dc5bd1888d391e357442728adbedf89c52
parenta514c374edcd33581cdcccf8faa7cc606a600319
idpf: fix memory leak of flow steer list on rmmod

[ Upstream commit f9841bd28b600526ca4f6713b0ca49bf7bb98452 ]

The flow steering list maintains entries that are added and removed as
ethtool creates and deletes flow steering rules. Module removal with active
entries causes memory leak as the list is not properly cleaned up.

Prevent this by iterating through the remaining entries in the list and
freeing the associated memory during module removal. Add a spinlock
(flow_steer_list_lock) to protect the list access from multiple threads.

Fixes: ada3e24b84a0 ("idpf: add flow steering support")
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Signed-off-by: Sreedevi Joshi <sreedevi.joshi@intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Tested-by: Mina Almasry <almasrymina@google.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/intel/idpf/idpf.h
drivers/net/ethernet/intel/idpf/idpf_ethtool.c
drivers/net/ethernet/intel/idpf/idpf_lib.c