Skip to content
This repository was archived by the owner on Oct 31, 2024. It is now read-only.

Commit dd41dab

Browse files
Eddie Jamesgregkh
Eddie James
authored andcommitted
net/ncsi: Disable the ncsi work before freeing the associated structure
[ Upstream commit a0ffa68 ] The work function can run after the ncsi device is freed, resulting in use-after-free bugs or kernel panic. Fixes: 2d283bd ("net/ncsi: Resource management") Signed-off-by: Eddie James <eajames@linux.ibm.com> Link: https://patch.msgid.link/20240925155523.1017097-1-eajames@linux.ibm.com Signed-off-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 4661c91 commit dd41dab

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

net/ncsi/ncsi-manage.c

+2
Original file line numberDiff line numberDiff line change
@@ -1954,6 +1954,8 @@ void ncsi_unregister_dev(struct ncsi_dev *nd)
19541954
list_del_rcu(&ndp->node);
19551955
spin_unlock_irqrestore(&ncsi_dev_lock, flags);
19561956

1957+
disable_work_sync(&ndp->work);
1958+
19571959
kfree(ndp);
19581960
}
19591961
EXPORT_SYMBOL_GPL(ncsi_unregister_dev);

0 commit comments

Comments
 (0)