Netdev List
 help / color / mirror / Atom feed
From: Fang Xieyan <fangxy@xiaopeng.com>
To: netdev-bot+sinfo@kernel.org
Cc: "Chandrashekar Devegowda" <chandrashekar.devegowda@intel.com>,
	"Loic Poulain" <loic.poulain@oss.qualcomm.com>,
	"Sergey Ryazanov" <ryazanov.s.a@gmail.com>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	netdev@vger.kernel.org, "Liu Haijun" <haijun.liu@mediatek.com>,
	"Johannes Berg" <johannes@sipsolutions.net>,
	"Andrew Lunn" <andrew+netdev@lunn.ch>,
	"David S . Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@kernel.org>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org,
	"Lin Qiaojie" <linqj@xiaopeng.com>
Subject: Re: [PATCH net v2] net: wwan: t7xx: validate PIT data before building RX skb
Date: Tue, 24 Nov 2026 07:39:36 +0800	[thread overview]
Message-ID: <20261123233936.51601-1-fangxy@xiaopeng.com> (raw)
In-Reply-To: <179545421789.3294.8652562780118952990@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 is reproduced at runtime, not only theoretical. No t7xx hardware
is available, so a fault-injection harness in a KASAN-enabled QEMU
guest synthesizes malformed PIT entries and drives the RX assembly
paths; this is a synthetic trigger, not a natural one.

On the normal path, a PIT data address 128 bytes below the BAT DMA
base yields an int offset of -128. The unpatched code accepts it,
skb_reserve() moves skb->data before skb->head, and reading the
payload triggers:

  BUG: KASAN: slab-out-of-bounds in t7xx15_harness_run+0x1a5e/0x2340 [mtk_t7xx]
  Read of size 1 at addr ff110000013bd000 by task insmod/71
  Call Trace:
   <TASK>
   dump_stack_lvl+0x55/0x70
   print_report+0x10d/0x5d0
   kasan_report+0x96/0xd0
   t7xx15_harness_run+0x1a5e/0x2340 [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 ff110000013bcd00
   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 [ff110000013bcd00, ff110000013bcfc0)

A second input, where the u64 address difference narrows to a small
positive int, is also accepted by the unpatched code. On the
fragment path, a negative offset likewise reaches the page copy and
faults on an unmapped address. With this patch applied, all of
these inputs are rejected (-ENOBUFS on the normal path, -EINVAL on
the fragment path) and no KASAN report or fault is produced.

  reply	other threads:[~2026-11-23 23:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-23 17:15 [PATCH net v2] net: wwan: t7xx: validate PIT data before building RX skb Fang Xieyan
2026-11-23 17:16 ` netdev-bot+sinfo
2026-11-23 23:39   ` Fang Xieyan [this message]
2026-11-24 18:17 ` netdev-bot+sashiko

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=20261123233936.51601-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