🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #21375

Re: [PATCH net v2] net: wwan: t7xx: validate PIT data before building RX skb

#21375
From: Fang Xieyan
Date: Mon, 23 Nov 2026 23:39
44 lines
10736 bytes
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.
Technical Details
Message-ID: <20261123233936.51601-1-fangxy@xiaopeng.com>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!2.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!peer02.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-369847-linux-kernel-netdev=dewy.ru
References: <20261123171519.33975-1-fangxy@xiaopeng.com> <179545421789.3294.8652562780118952990@kernel.org>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!2.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!peer02.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-369847-linux-kernel-netdev=dewy.ru
From: fangxy@xiaopeng.com (Fang Xieyan)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net v2] net: wwan: t7xx: validate PIT data before building RX skb
Date: Tue, 24 Nov 2026 07:39:36 +0800
Organization: Usenet Network
Message-ID: <20261123233936.51601-1-fangxy@xiaopeng.com>
References: <20261123171519.33975-1-fangxy@xiaopeng.com> <179545421789.3294.8652562780118952990@kernel.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network; logging-data="4008949"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:57rJK4BILIDpOfVU652Qqh46LBg= sha256:LO7GgAwTpzaqSJ+Ew7Gli22X4iknytBzodV4n/a6Rpw= sha1:6824DBoyNnMFAXGquredoUpIFyY= sha256:JRZUQ2xOPLcpG5P4nEBXuKKncQmLbvOKxWkBXBbXXSM=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 9C701125DC9; Tue, 24 Nov 2026 02:40:57 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.049
X-Spam-Status: No, score=-3.049 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, UNPARSEABLE_RELAY=0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key) header.d=xiaopeng.com
X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OrV3IqltEifR; Tue, 24 Nov 2026 02:40:54 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-369847-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=xiaopeng.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 12F29125DC6; Tue, 24 Nov 2026 02:40:43 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 121213C961; Mon, 23 Nov 2026 23:40:05 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1795477194; b=srA8nMT3Al7HbIbIV/2DxwCWnJchXs60g1RJ2uy4cRtb2UjJsOq49KIMt99Eg8S7U+WM c6tVJcwWyeSBX0HydoDJwHP71gEXnLVgiKy9sEKSvdbVACJy8mdOv/a3a6bMeDuy67RsA FRu4sL3MNhp3XfDA6LtkSw6USZSvDkGMgomCxMovYzAudB4rWYByi5RVmnvNAlk6oJHew IRr6XU7t+HgfSpbF8V1ff/qEpkrwTtNeHbtD24Ad45YsConamTkcwSDMvA3/TxsBo1eCZ P8Y5G0jepOe5ImtAcrMoXvaXAjPH6JlQZYEhbJ2thuN1uQEg/XmLjCk8ASUDjHRtMTw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795477194; h=X-Original-To:Received:DMARC-Filter:DKIM-Signature: X-Alimail-AntiSpam:Received:From:To:Cc:Subject:Date:Message-ID: X-Mailer:In-Reply-To:References:X-Mailing-List:List-Id:List-Post: List-Help:List-Subscribe:List-Unsubscribe:List-Owner:Precedence: MIME-Version:Content-Transfer-Encoding; bh=GQphScNATQHHldgFgEcB68heOuz1yKCUAO9uOSn7l/E=; b=zrRm0MmqHp3slvjZLIajc3+7g05BtffEE/vufaczg62/IrPzJHv4xkmhSctQACL+nt8C FyLRjpw33KsK5L9mtIh0yK+r+5v5lCc5P55bYMxNE2xD8prdBQJYPTggQbsJ3BDP3X6iY CbJDG5SR3JWCgvEADrsAtCt3cdx2/sPs1ktE2FxOL92m8z6H9C749Mgtdwc0wAgre2Idk UxQR0PKDRH/7Lxe8DZMd9q+7Brc2NZnlfTsVwBOquXUL/a5iktrfTQmyqiGdh48tXbEHu OmjzmbIHs2l+/9om84glWXOz29jFsi8fTc/eQjghrHLtr5nRuyBbDMyGxwUYbtAeU8g==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=xiaopeng.com header.i=@xiaopeng.com header.a=rsa-sha256 header.s=default header.b=DF42BqXj; dmarc=none header.from=xiaopeng.com; spf=pass smtp.mailfrom=xiaopeng.com; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C5356606A699; Mon, 23 Nov 2026 23:39:54 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=xiaopeng.com header.i=@xiaopeng.com header.a=rsa-sha256 header.s=default header.b=DF42BqXj
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=115.124.28.99
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795477194; b=mxnI532ObZ0qgx77CAKb9JgdK74IwOfESumBAhmxA+33cFl7LoWzNKw5ZJxiyjAY+Zpp d0ORj2df6Z+N92PU70MdthWC6Ji+1bo883Z1U0cbeyIAMoFGkY3S53FZRhHqJ0I7EmtE3 S2Z+YmEv5nE4fM2wU9x/mY7BA3ggsnybBshBkEr0rs7b5bcr3KU/Lz9BB+GyHEeXKN2EL u6ZGsCWMrq3j3Khr2ktTztiHyz6bJgB+jmBHOqkr9PB8UFj4v+kIf0FDF6e+sKL9vbaGU ImIswzwwqiPnUA6CjzTI2i8KJYAQTaXedAZ2HNNAnFuUzkmzlvnyImKz8zOSJzSAXag==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795477194; h=DMARC-Filter:DKIM-Signature:X-Alimail-AntiSpam:Received:From:To:Cc: Subject:Date:Message-ID:X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding; bh=GQphScNATQHHldgFgEcB68heOuz1yKCUAO9uOSn7l/E=; b=shMrdllPTn2ZAej1UaGZHVO/S4fY3MRMxAJghEOs+kEjGHhOyVfnz0RFfuYtlING26ET 3XfGMItT85M3BBy6PPnUPYJPPxmDEBrQu8ZdbFu06t8SokSWpjHCWLKCBPO5gFwqJfufa oVTnAoGgjkWdy8I4WlrDRxQ9LbqN1qEK50hnqkYgvs4PpCHDWDEne1psjTTiG3FdM4NpV L/dhvsHj82bpCFICtFEpHfRXXz8roWb/eZGh6vKp0uKNn30bAsnDRFCanXzJBf41J8HIe 9lvxFaEWwQiERyOCIBLni5XazX+pTLhD8dx0AE+BP19AVd1nswIHylLE9bFDycavOHg==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none header.from=xiaopeng.com; spf=pass smtp.mailfrom=xiaopeng.com; dkim=pass header.d=xiaopeng.com header.i=@xiaopeng.com header.a=rsa-sha256 header.s=default header.b=DF42BqXj; arc=none smtp.remote-ip=115.124.28.99
X-Received: from out28-99.mail.aliyun.com (out28-99.mail.aliyun.com [115.124.28.99]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C4466606A6A6; Mon, 23 Nov 2026 23:39:51 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org C4466606A6A6
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=xiaopeng.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=xiaopeng.com
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xiaopeng.com; s=default; t=1795477184; h=From:To:Subject:Date:Message-ID:MIME-Version; bh=GQphScNATQHHldgFgEcB68heOuz1yKCUAO9uOSn7l/E=; b=DF42BqXjUdPkQLpCBC5CtznPLQOQTUGHZFL+h9zdNSlL6hvmVlslfN2+9T1AN8aFdDyCTn01AiPsF1WML9OU6BY/VLNjO8yXZfYpN2nLf8gomaaJ81EJwf/NpjftDJjfcJgDzuaDaf7lVgxjUQ6+KfVReX0uCoKs9I54yL5Uzsw=
X-Alimail-AntiSpam: AC=CONTINUE;BC=0.04998161|-1;CH=green;DM=|CONTINUE|false|;DS=CONTINUE|ham_system_inform|0.00557952-0.000104749-0.994316;FP=12015874423884973311|0|0|0|0|-1|-1|-1;HT=maildocker-contentspam033037032112;MF=fangxy@xiaopeng.com;NM=1;PH=DS;RN=16;RT=16;SR=0;TI=SMTPD_---.k8dSJk7_1795477180;
X-Received: from localhost.localdomain(mailfrom:fangxy@xiaopeng.com fp:SMTPD_---.k8dSJk7_1795477180 cluster:ay29) by smtp.aliyun-inc.com; Tue, 24 Nov 2026 07:39:42 +0800
X-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>
X-Mailer: git-send-email 2.50.1
X-In-Reply-To: <179545421789.3294.8652562780118952990@kernel.org>
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-Received-Bytes: 10477