linux/drivers/net/wwan
Pavitra Jha 0e7c074cfc net: wwan: t7xx: validate port_count against message length in t7xx_port_enum_msg_handler
t7xx_port_enum_msg_handler() uses the modem-supplied port_count field as
a loop bound over port_msg->data[] without checking that the message buffer
contains sufficient data. A modem sending port_count=65535 in a 12-byte
buffer triggers a slab-out-of-bounds read of up to 262140 bytes.

Add a sizeof(*port_msg) check before accessing the port message header
fields to guard against undersized messages.

Add a struct_size() check after extracting port_count and before the loop.

In t7xx_parse_host_rt_data(), guard the rt_feature header read with a
remaining-buffer check before accessing data_len, validate feat_data_len
against the actual remaining buffer to prevent OOB reads and signed
integer overflow on offset.

Pass msg_len from both call sites: skb->len at the DPMAIF path after
skb_pull(), and the validated feat_data_len at the handshake path.

Fixes: da45d2566a ("net: wwan: t7xx: Add control port")
Cc: stable@vger.kernel.org
Signed-off-by: Pavitra Jha <jhapavitra98@gmail.com>
Link: https://patch.msgid.link/20260501110713.145563-1-jhapavitra98@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-05-05 19:05:11 -07:00
..
iosm Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
t7xx net: wwan: t7xx: validate port_count against message length in t7xx_port_enum_msg_handler 2026-05-05 19:05:11 -07:00
Kconfig net: wwan: add NMEA port support 2026-01-30 18:26:59 -08:00
Makefile net: wwan: t7xx: Add core components 2022-05-09 10:51:59 +01:00
mhi_wwan_ctrl.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
mhi_wwan_mbim.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2026-01-22 20:14:36 -08:00
qcom_bam_dmux.c net: wwan: Remove redundant pm_runtime_mark_last_busy() calls 2025-10-29 18:55:56 -07:00
rpmsg_wwan_ctrl.c net: wwan: replace deprecated strncpy with strscpy 2023-10-20 18:15:05 -07:00
wwan_core.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
wwan_hwsim.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00