Commit 846eb7c
nvme-fc: do not wait in vain when unloading module
jira VULN-37041
cve CVE-2024-26846
commit-author Daniel Wagner <dwagner@suse.de>
commit 70fbfc4
The module exit path has race between deleting all controllers and
freeing 'left over IDs'. To prevent double free a synchronization
between nvme_delete_ctrl and ida_destroy has been added by the initial
commit.
There is some logic around trying to prevent from hanging forever in
wait_for_completion, though it does not handling all cases. E.g.
blktests is able to reproduce the situation where the module unload
hangs forever.
If we completely rely on the cleanup code executed from the
nvme_delete_ctrl path, all IDs will be freed eventually. This makes
calling ida_destroy unnecessary. We only have to ensure that all
nvme_delete_ctrl code has been executed before we leave
nvme_fc_exit_module. This is done by flushing the nvme_delete_wq
workqueue.
While at it, remove the unused nvme_fc_wq workqueue too.
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: Keith Busch <kbusch@kernel.org>
(cherry picked from commit 70fbfc4)
Signed-off-by: CIQ Kernel Automation <ciq_kernel_automation@ciq.com>1 parent 089c55a commit 846eb7c
1 file changed
Lines changed: 6 additions & 41 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
221 | 221 | | |
222 | 222 | | |
223 | 223 | | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | 224 | | |
230 | 225 | | |
231 | 226 | | |
| |||
255 | 250 | | |
256 | 251 | | |
257 | 252 | | |
258 | | - | |
259 | | - | |
260 | 253 | | |
261 | 254 | | |
262 | 255 | | |
| |||
3899 | 3892 | | |
3900 | 3893 | | |
3901 | 3894 | | |
3902 | | - | |
3903 | | - | |
3904 | | - | |
3905 | | - | |
3906 | 3895 | | |
3907 | 3896 | | |
3908 | 3897 | | |
| |||
3920 | 3909 | | |
3921 | 3910 | | |
3922 | 3911 | | |
3923 | | - | |
| 3912 | + | |
3924 | 3913 | | |
3925 | 3914 | | |
3926 | 3915 | | |
| |||
3944 | 3933 | | |
3945 | 3934 | | |
3946 | 3935 | | |
3947 | | - | |
3948 | | - | |
3949 | 3936 | | |
3950 | 3937 | | |
3951 | 3938 | | |
| |||
3965 | 3952 | | |
3966 | 3953 | | |
3967 | 3954 | | |
3968 | | - | |
3969 | | - | |
| 3955 | + | |
3970 | 3956 | | |
3971 | 3957 | | |
3972 | 3958 | | |
3973 | | - | |
3974 | | - | |
3975 | | - | |
3976 | | - | |
3977 | | - | |
3978 | | - | |
3979 | | - | |
3980 | | - | |
3981 | | - | |
3982 | | - | |
3983 | 3959 | | |
3984 | | - | |
3985 | 3960 | | |
3986 | 3961 | | |
3987 | | - | |
3988 | | - | |
3989 | | - | |
3990 | | - | |
3991 | | - | |
| 3962 | + | |
| 3963 | + | |
| 3964 | + | |
3992 | 3965 | | |
3993 | | - | |
3994 | | - | |
3995 | | - | |
3996 | | - | |
3997 | | - | |
| 3966 | + | |
3998 | 3967 | | |
3999 | 3968 | | |
4000 | 3969 | | |
4001 | | - | |
4002 | | - | |
4003 | | - | |
4004 | 3970 | | |
4005 | 3971 | | |
4006 | | - | |
4007 | 3972 | | |
4008 | 3973 | | |
4009 | 3974 | | |
| |||
0 commit comments