Re: [PATCH net] net: wwan: t7xx: validate PIT data offset before skb_reserve

From: Fang Xieyan

Date: Thu Nov 19 2026 - 04:59:59 EST


The issue was found during a security review of the t7xx driver's
device-supplied input paths, assisted by the Hawkeye agent
(LLM-based code analysis).

It has now been reproduced with a fault-injection harness in a
KASAN-enabled QEMU guest. No t7xx hardware is available, so the
harness synthesizes a malformed PIT and calls
t7xx_dpmaif_set_data_to_skb() directly; this is a synthetic trigger,
not a natural one.

With a PIT data address 128 bytes below the BAT DMA base, the int
offset becomes -128. The existing tail+length check passes because
the unsigned tail wraps, skb_reserve() then moves skb->data 64 bytes
before skb->head, and reading the payload triggers:

BUG: KASAN: slab-out-of-bounds in t7xx15_harness_run+0xa4f/0xda0 [mtk_t7xx]
Read of size 1 at addr ff11000002095340 by task insmod/67
Call Trace:
<TASK>
dump_stack_lvl+0x55/0x70
print_report+0x10d/0x5d0
kasan_report+0x96/0xd0
t7xx15_harness_run+0xa4f/0xda0 [mtk_t7xx]
t7xx_pci_init+0x9/0xff0 [mtk_t7xx]
do_one_initcall+0x84/0x350
do_init_module+0x29d/0x800
load_module+0x510c/0x6630
init_module_from_file+0x15d/0x180
idempotent_init_module+0x320/0x670
__x64_sys_finit_module+0xbd/0x120
do_syscall_64+0xee/0x500
entry_SYSCALL_64_after_hwframe+0x77/0x7f
</TASK>
The buggy address belongs to the object at ff11000002095040
which belongs to the cache skbuff_small_head of size 704
The buggy address is located 64 bytes to the right of
allocated 704-byte region [ff11000002095040, ff11000002095300)

The read address matches the corrupted skb->data (skb->head - 64).
A second case, where the u64 address difference narrows to a small
positive int, is also accepted by the unpatched code. With this
patch applied, both inputs are rejected with -ENOBUFS and no KASAN
report is produced.