Commit efc54fb
iavf: fix PTP use-after-free during reset
Commit 7c01dbf ("iavf: periodically cache PHC time") introduced a
worker to cache PHC time, but failed to stop it during reset or disable.
This creates a race condition where `iavf_reset_task()` or
`iavf_disable_vf()` free adapter resources (AQ) while the worker is still
running. If the worker triggers `iavf_queue_ptp_cmd()` during teardown, it
accesses freed memory/locks, leading to a crash.
Fix this by calling `iavf_ptp_release()` before tearing down the adapter.
This ensures `ptp_clock_unregister()` synchronously cancels the worker and
cleans up the chardev before the backing resources are destroyed.
Fixes: 7c01dbf ("iavf: periodically cache PHC time")
Signed-off-by: Petr Oros <poros@redhat.com>
Reviewed-by: Ivan Vecera <ivecera@redhat.com>
Acked-by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>1 parent bd98c62 commit efc54fb
1 file changed
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3036 | 3036 | | |
3037 | 3037 | | |
3038 | 3038 | | |
| 3039 | + | |
| 3040 | + | |
3039 | 3041 | | |
3040 | 3042 | | |
3041 | 3043 | | |
| |||
3211 | 3213 | | |
3212 | 3214 | | |
3213 | 3215 | | |
| 3216 | + | |
| 3217 | + | |
3214 | 3218 | | |
3215 | 3219 | | |
3216 | 3220 | | |
| |||
0 commit comments