linux/drivers/net/wwan
Guanglei Zhu c7ead97042 net: wwan: t7xx: validate the netif index in t7xx_ccmni_recv_skb()
The netif index carried in the DPMAIF PIT header is five bits wide,
but ccmni_inst[] only has room for NIC_DEV_MAX (21) entries.
t7xx_ccmni_recv_skb() indexes the array without a bounds check, so
indexes 21 to 31 read past it.  The out-of-bounds value lands in the
callback table that follows the array, which is never NULL, so the
existing !ccmni check does not catch it and the driver dereferences
whatever sits there as a struct t7xx_ccmni.

Drop the skb when the index is out of range.

Fixes: 05d19bf500 ("net: wwan: t7xx: Add WWAN network interface")
Cc: stable@vger.kernel.org
Signed-off-by: Guanglei Zhu <zhugl3@xiaopeng.com>

Verified in a QEMU guest with a fault injector setting the netif
index to 25: the unpatched driver reads a value past ccmni_inst[],
which lands in the callback table, and dereferences it far enough to
queue the skb.  With this check the packet is dropped.  Well-formed
traffic on index 0 is unaffected.

Changes in v2: none.

Link: https://patch.msgid.link/20260911021734.1396599-3-zhugl3@xiaopeng.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-09-16 18:58:45 -07:00
..
iosm net: wwan: iosm: bound device offsets in the MUX downlink decoder 2026-06-29 17:50:56 -07:00
t7xx net: wwan: t7xx: validate the netif index in t7xx_ccmni_recv_skb() 2026-09-16 18:58:45 -07:00
Kconfig net: Unify user-visible "Qualcomm" name 2026-04-29 16:38:54 -07:00
Makefile net: wwan: t7xx: Add core components 2022-05-09 10:51:59 +01:00
mhi_wwan_ctrl.c Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c files) 2026-07-03 07:38:17 +02:00
mhi_wwan_mbim.c net: wwan: mhi_wwan_mbim: check skb_copy_bits() return value 2026-09-16 18:58:45 -07:00
qcom_bam_dmux.c Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c files) 2026-07-03 07:38:17 +02:00
rpmsg_wwan_ctrl.c Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c files) 2026-07-03 07:38:17 +02:00
wwan_core.c net: wwan: add exclusive open mode capability to AT and QCDM ports 2026-07-30 11:05:14 +02:00
wwan_hwsim.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00