ice: fix NULL access of tx->in_use in ice_ll_ts_intr
authorJacob Keller <jacob.e.keller@intel.com>
Thu, 7 Aug 2025 17:35:27 +0000 (10:35 -0700)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Tue, 2 Sep 2025 18:05:50 +0000 (11:05 -0700)
commitf6486338fde3f04ed0ec59fe67a69a208c32734f
treebd748e2d0ab8b6cfbd8323f9bf84892316eeedca
parent403bf043d9340196e06769065169df7444b91f7a
ice: fix NULL access of tx->in_use in ice_ll_ts_intr

Recent versions of the E810 firmware have support for an extra interrupt to
handle report of the "low latency" Tx timestamps coming from the
specialized low latency firmware interface. Instead of polling the
registers, software can wait until the low latency interrupt is fired.

This logic makes use of the Tx timestamp tracking structure, ice_ptp_tx, as
it uses the same "ready" bitmap to track which Tx timestamps complete.

Unfortunately, the ice_ll_ts_intr() function does not check if the
tracker is initialized before its first access. This results in NULL
dereference or use-after-free bugs similar to the issues fixed in the
ice_ptp_ts_irq() function.

Fix this by only checking the in_use bitmap (and other fields) if the
tracker is marked as initialized. The reset flow will clear the init field
under lock before it tears the tracker down, thus preventing any
use-after-free or NULL access.

Fixes: 82e71b226e0e ("ice: Enable SW interrupt from FW for LL TS")
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>
Tested-by: Rinitha S <sx.rinitha@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/ice/ice_main.c