Malformed modem PIT/BAT and handshake blobs can OOB the host driver. An in-flight CLDMA IRQ can requeue work after stop and UAF the rings. Handshake work and skb ownership races can double-free. Each patch is one failure class: 0001 DPMAIF RX validation and BAT refill A.1.a PIT/BAT buffer_id used as index before validation A.1.c partial BAT refill loses unreplenished RX slots B.4 PIT nr_frags exceeds MAX_SKB_FRAGS B.5 32-bit DMA offset truncates a 64-bit address A.1.b already in t7xx_ccmni_recv_skb() (no change) 0002 control / PORT_ENUM payload length B.3 PORT_ENUM length / port_count OOB 0003 runtime-feature handshake blob bounds B.1 malformed runtime-feature data OOB read 0004 CLDMA IRQ/work vs ring teardown B.2 in-flight IRQ requeues work after stop (UAF) F.3 same class; not copied from the Fibocom empty-handler lock wrap 0005 handshake races and remaining skb lifetime bugs F.1 MHCCIF re-queues handshake while the first run is active F.2 core_ap.ready stays set; handshake races cldma_reset F.4 CLDMA TX sleep-disable timeout double-free F.5 dedicated recv error return double-free F.6 DPMAIF TX peek/unlink UAF 0001 is DPMAIF data path only. Control-message checks are 0002. B.1 still rejects a truncated feature (-EINVAL) but does not require FEATURE_COUNT entries; firmware may advertise a subset of complete features. Signed-off-by: Wanquan Zhong <zwq2…@163.com> --- Wanquan Zhong (5): t7xx: validate PIT/BAT ids and restore failed RX BAT refill t7xx: validate control-message and PORT_ENUM payload lengths t7xx: reject malformed runtime-feature handshake data t7xx: stop in-flight CLDMA IRQ and work before ring teardown t7xx: fix handshake races and skb double-free on TX/RX drivers/net/wwan/t7xx/t7xx_hif_cldma.c | 125 +++++++---- drivers/net/wwan/t7xx/t7xx_hif_cldma.h | 2 + drivers/net/wwan/t7xx/t7xx_hif_dpmaif.c | 4 +- drivers/net/wwan/t7xx/t7xx_hif_dpmaif.h | 1 + drivers/net/wwan/t7xx/t7xx_hif_dpmaif_rx.c | 231 ++++++++++++++++----- drivers/net/wwan/t7xx/t7xx_hif_dpmaif_rx.h | 7 +- drivers/net/wwan/t7xx/t7xx_hif_dpmaif_tx.c | 5 +- drivers/net/wwan/t7xx/t7xx_modem_ops.c | 65 ++++-- drivers/net/wwan/t7xx/t7xx_port_ctrl_msg.c | 21 +- drivers/net/wwan/t7xx/t7xx_port_proxy.c | 3 +- drivers/net/wwan/t7xx/t7xx_state_monitor.c | 1 + 11 files changed, 353 insertions(+), 112 deletions(-)
-- 2.53.0