Aaron Ma
fc6f36eaae
ice: Fix PTP NULL pointer dereference during VSI rebuild
Fix race condition where PTP periodic work runs while VSI is being
rebuilt, accessing NULL vsi->rx_rings.
The sequence was:
1. ice_ptp_prepare_for_reset() cancels PTP work
2. ice_ptp_rebuild() immediately queues PTP work
3. VSI rebuild happens AFTER ice_ptp_rebuild()
4. PTP work runs and accesses NULL vsi->rx_rings
Fix: Keep PTP work cancelled during rebuild, only queue it after
VSI rebuild completes in ice_rebuild().
Added ice_ptp_queue_work() helper function to encapsulate the logic
for queuing PTP work, ensuring it's only queued when PTP is supported
and the state is ICE_PTP_READY.
Error log:
[ 121.392544] ice 0000:60:00.1: PTP reset successful
[ 121.392692] BUG: kernel NULL pointer dereference, address: 0000000000000000
[ 121.392712] #PF: supervisor read access in kernel mode
[ 121.392720] #PF: error_code(0x0000) - not-present page
[ 121.392727] PGD 0
[ 121.392734] Oops: Oops: 0000 [#1] SMP NOPTI
[ 121.392746] CPU: 8 UID: 0 PID: 1005 Comm: ice-ptp-0000:60 Tainted: G S 6.19.0-rc6+ #4 PREEMPT(voluntary)
[ 121.392761] Tainted: [S]=CPU_OUT_OF_SPEC
[ 121.392773] RIP: 0010:ice_ptp_update_cached_phctime+0xbf/0x150 [ice]
[ 121.393042] Call Trace:
[ 121.393047] <TASK>
[ 121.393055] ice_ptp_periodic_work+0x69/0x180 [ice]
[ 121.393202] kthread_worker_fn+0xa2/0x260
[ 121.393216] ? __pfx_ice_ptp_periodic_work+0x10/0x10 [ice]
[ 121.393359] ? __pfx_kthread_worker_fn+0x10/0x10
[ 121.393371] kthread+0x10d/0x230
[ 121.393382] ? __pfx_kthread+0x10/0x10
[ 121.393393] ret_from_fork+0x273/0x2b0
[ 121.393407] ? __pfx_kthread+0x10/0x10
[ 121.393417] ret_from_fork_asm+0x1a/0x30
[ 121.393432] </TASK>
Fixes: 803bef8178 ("ice: factor out ice_ptp_rebuild_owner()")
Signed-off-by: Aaron Ma <aaron.ma@canonical.com>
Tested-by: Sunitha Mekala <sunithax.d.mekala@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
2026-01-30 09:08:06 -08:00
..
2025-12-15 13:00:03 -06:00
2026-01-13 23:10:25 +01:00
2025-12-05 17:29:04 -08:00
2025-12-29 11:34:16 +01:00
2026-01-13 22:00:02 +09:00
2026-01-08 08:47:32 -08:00
2026-01-24 10:13:22 -08:00
2026-01-23 12:53:56 -08:00
2026-01-22 13:22:22 -05:00
2025-12-06 18:34:24 -08:00
2025-11-21 18:42:02 +00:00
2025-12-06 18:34:24 -08:00
2025-12-08 09:38:52 +09:00
2026-01-14 17:42:46 -07:00
2026-01-16 16:43:51 +01:00
2025-12-22 20:03:23 +09:00
2025-12-16 07:59:30 -06:00
2025-12-05 17:29:04 -08:00
2025-12-29 08:44:14 +08:00
2026-01-13 08:30:40 -07:00
2026-01-14 22:16:26 -08:00
2025-11-26 13:58:59 +09:00
2025-11-27 18:11:43 -08:00
2026-01-11 22:12:49 +05:30
2025-12-04 18:42:48 -08:00
2026-01-22 08:08:42 -08:00
2026-01-04 08:35:39 +01:00
2025-12-26 22:04:03 +09:00
2026-01-19 12:30:00 -08:00
2025-11-10 15:03:13 +08:00
2025-11-20 16:44:04 +01:00
2025-11-26 14:28:19 +01:00
2026-01-21 14:06:17 +01:00
2026-01-23 10:13:12 +10:00
2025-11-26 14:40:59 +01:00
2026-01-08 07:44:48 -08:00
2026-01-15 07:29:14 +00:00
2025-12-19 08:44:22 -08:00
2026-01-16 16:42:41 +01:00
2026-01-24 12:56:53 +01:00
2025-12-12 23:59:39 +01:00
2026-01-11 13:25:15 +00:00
2025-12-30 06:45:51 -05:00
2026-01-25 09:42:25 -08:00
2026-01-12 01:58:36 +02:00
2026-01-23 12:46:12 -08:00
2026-01-20 10:11:29 +01:00
2026-01-20 18:37:41 -08:00
2026-01-20 16:02:01 +00:00
2025-12-05 17:29:04 -08:00
2025-11-28 09:47:44 -06:00
2026-01-23 12:53:56 -08:00
2026-01-14 08:18:01 -08:00
2025-12-05 17:29:04 -08:00
2025-11-12 21:28:26 -05:00
2025-12-04 15:18:33 -08:00
2026-01-16 16:43:47 +01:00
2026-01-22 13:26:08 +01:00
2025-11-09 11:15:20 +09:00
2026-01-11 06:09:11 -10:00
2026-01-16 16:42:08 +01:00
2026-01-30 09:08:06 -08:00
2026-01-17 18:02:50 -08:00
2026-01-17 11:57:39 -05:00
2025-12-06 09:32:25 -08:00
2026-01-16 20:59:46 -08:00
2025-12-06 18:34:24 -08:00
2026-01-17 10:20:43 -06:00
2025-12-19 13:56:17 +01:00
2026-01-23 13:20:24 -08:00
2025-12-06 18:34:24 -08:00
2025-12-02 17:03:55 -08:00
2026-01-14 21:44:39 +05:30
2026-01-27 10:06:27 +01:00
2026-01-20 17:10:56 +02:00
2026-01-23 13:12:49 -08:00
2025-11-18 17:35:36 +01:00
2025-12-05 17:29:04 -08:00
2025-12-17 17:24:28 +01:00
2025-12-03 12:42:36 -08:00
2025-12-03 17:24:33 -08:00
2026-01-19 18:31:05 +01:00
2025-12-04 17:10:08 -08:00
2026-01-19 14:42:02 +00:00
2025-11-29 15:20:23 -06:00
2026-01-16 12:04:20 +00:00
2025-12-08 09:38:52 +09:00
2025-11-26 10:16:10 -06:00
2025-12-13 17:09:06 +12:00
2026-01-20 14:33:42 +01:00
2026-01-16 23:08:11 -05:00
2025-11-14 10:01:52 +01:00
2026-01-16 16:43:05 +01:00
2026-01-15 18:13:33 -07:00
2026-01-18 12:29:12 -08:00
2026-01-15 14:21:29 +00:00
2025-12-06 18:52:00 -08:00
2026-01-16 23:02:15 -05:00
2025-11-21 21:27:20 +01:00
2025-12-15 12:47:39 +01:00
2025-12-06 18:42:12 -08:00
2026-01-23 17:23:09 +01:00
2026-01-04 15:48:50 -05:00
2026-01-16 16:43:43 +01:00
2026-01-16 12:19:37 +01:00
2025-12-05 13:52:43 -08:00
2026-01-23 08:47:48 -07:00
2025-12-24 08:02:57 -05:00
2025-12-06 15:41:26 -08:00
2025-12-04 17:34:16 -08:00
2025-11-27 02:03:07 -05:00
2025-12-28 11:52:10 +01:00
2025-12-06 10:00:49 -08:00
2026-01-25 12:06:15 -08:00
2025-12-06 18:52:00 -08:00
2025-12-06 18:52:00 -08:00