Netdev List
 help / color / mirror / Atom feed
From: Fang Xieyan <fangxy@xiaopeng.com>
To: netdev-bot+sinfo@kernel.org
Cc: fangxy@xiaopeng.com, chandrashekar.devegowda@intel.com,
	loic.poulain@oss.qualcomm.com, ryazanov.s.a@gmail.com,
	ilpo.jarvinen@linux.intel.com, netdev@vger.kernel.org,
	haijun.liu@mediatek.com, johannes@sipsolutions.net,
	andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org,
	kuba@kernel.org, pabeni@redhat.com, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org, linqj@xiaopeng.com
Subject: Re: [PATCH net] net: wwan: t7xx: validate PIT data offset before skb_reserve
Date: Thu, 19 Nov 2026 17:59:33 +0800	[thread overview]
Message-ID: <20261119095933.41076-1-fangxy@xiaopeng.com> (raw)
In-Reply-To: <179506943682.3291.10326179398413921657@kernel.org>

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.

      reply	other threads:[~2026-11-19  9:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-19  6:20 [PATCH net] net: wwan: t7xx: validate PIT data offset before skb_reserve Fang Xieyan
2026-11-19  6:23 ` netdev-bot+sinfo
2026-11-19  9:59   ` Fang Xieyan [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261119095933.41076-1-fangxy@xiaopeng.com \
    --to=fangxy@xiaopeng.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=chandrashekar.devegowda@intel.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=haijun.liu@mediatek.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=johannes@sipsolutions.net \
    --cc=kuba@kernel.org \
    --cc=linqj@xiaopeng.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=loic.poulain@oss.qualcomm.com \
    --cc=netdev-bot+sinfo@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=ryazanov.s.a@gmail.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox