From: "Wu. JackBB (GSM)" <JackBB_Wu@compal.com>
To: Simon Horman <horms@kernel.org>
Cc: "loic.poulain@oss.qualcomm.com" <loic.poulain@oss.qualcomm.com>,
"ryazanov.s.a@gmail.com" <ryazanov.s.a@gmail.com>,
"johannes@sipsolutions.net" <johannes@sipsolutions.net>,
"andrew+netdev@lunn.ch" <andrew+netdev@lunn.ch>,
"davem@davemloft.net" <davem@davemloft.net>,
"edumazet@google.com" <edumazet@google.com>,
"kuba@kernel.org" <kuba@kernel.org>,
"pabeni@redhat.com" <pabeni@redhat.com>,
"wen-zhi.huang@mediatek.com" <wen-zhi.huang@mediatek.com>,
"shi-wei.yeh@mediatek.com" <shi-wei.yeh@mediatek.com>,
"Minano.tseng@mediatek.com" <Minano.tseng@mediatek.com>,
"matthias.bgg@gmail.com" <matthias.bgg@gmail.com>,
"angelogioacchino.delregno@collabora.com"
<angelogioacchino.delregno@collabora.com>,
"corbet@lwn.net" <corbet@lwn.net>,
"skhan@linuxfoundation.org" <skhan@linuxfoundation.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"linux-mediatek@lists.infradead.org"
<linux-mediatek@lists.infradead.org>,
"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>
Subject: RE: [External Mail] Re: [PATCH v4 4/7] net: wwan: t9xx: Add control port
Date: Fri, 17 Jul 2026 11:00:01 +0000 [thread overview]
Message-ID: <def80621b7b542008580609735872604@compal.com> (raw)
In-Reply-To: <3a3b077758604433a0ddca3f3467a561@compal.com>
Hi Simon,
After further internal review, we are correcting several
responses from our previous reply. The following items will
be fixed in v5.
On [date] Jack Wu wrote:
>> [Severity: High]
>> Can this lead to use-after-free and double-free on the skb?
> No. The recv callback (mtk_port_internal_recv) does not free
> the skb on error — it returns -ENXIO and leaves skb ownership
> with the caller.
>> [Severity: High]
>> This is where the second free of the skb occurs when propagating
>> the error from the recv callback.
> As above, the recv callback does not free the skb on error.
>> [Severity: High]
>> This is where the skb is freed on the error path before returning
>> -ENXIO.
> mtk_port_internal_recv() does not call dev_kfree_skb_any() on the
> error path.
Our previous response was incorrect. In Patch 4's code,
mtk_port_internal_recv's drop_data does have
dev_kfree_skb_any(skb) — the double-free and UAF are real.
Will remove dev_kfree_skb_any(skb) from
mtk_port_internal_recv's drop_data path in v5. The caller
(mtk_port_rx_dispatch) is the sole owner and frees the skb
on error.
>> [Severity: High]
>> Could this create an infinite loop in kernel space?
> This is intentional. Channel enable/disable are control plane
> operations that must complete or timeout. The loop does not
> busy-spin: each iteration sleeps in
> wait_event_interruptible_timeout until the condition is met or
> the timeout expires.
>> [Severity: High]
>> This appears to have the same infinite loop risk.
> Same reasoning as mtk_port_ch_enable.
Will change wait_event_interruptible_timeout to
wait_event_timeout in both mtk_port_ch_enable and
mtk_port_ch_disable, and remove the -ERESTARTSYS / goto
start_wait block.
>> [Severity: High]
>> Missing bounds check on msg->port_cnt in
>> mtk_port_status_update.
> The message is already validated by head_pattern, tail_pattern,
> and version checks before the loop. The modem firmware is a
> trusted source.
Will move data_len validation before the callback call in
mtk_fsm_parse_hs2_msg, pass data_len to the callback, and add
a bounds check in mtk_port_status_update:
if (data_len < sizeof(*msg) +
le16_to_cpu(msg->port_cnt) * sizeof(*port_info))
return -EPROTO;
Thanks.
Jack Wu
next prev parent reply other threads:[~2026-07-17 11:00 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-09 10:53 [PATCH v4 0/7] net: wwan: t9xx: Add MediaTek T9XX WWAN driver Jack Wu via B4 Relay
2026-07-09 10:53 ` [PATCH v4 1/7] net: wwan: t9xx: Add PCIe core Jack Wu via B4 Relay
2026-07-16 9:33 ` Simon Horman
2026-07-17 6:25 ` [External Mail] " Wu. JackBB (GSM)
2026-07-17 10:51 ` Wu. JackBB (GSM)
2026-07-09 10:53 ` [PATCH v4 2/7] net: wwan: t9xx: Add control plane transaction layer Jack Wu via B4 Relay
2026-07-16 9:33 ` Simon Horman
2026-07-17 6:27 ` [External Mail] " Wu. JackBB (GSM)
2026-07-17 10:53 ` Wu. JackBB (GSM)
2026-07-09 10:53 ` [PATCH v4 3/7] net: wwan: t9xx: Add control DMA interface Jack Wu via B4 Relay
2026-07-16 9:34 ` Simon Horman
2026-07-17 6:37 ` [External Mail] " Wu. JackBB (GSM)
2026-07-17 10:57 ` Wu. JackBB (GSM)
2026-07-09 10:53 ` [PATCH v4 4/7] net: wwan: t9xx: Add control port Jack Wu via B4 Relay
2026-07-16 9:34 ` Simon Horman
2026-07-17 7:20 ` [External Mail] " Wu. JackBB (GSM)
2026-07-17 11:00 ` Wu. JackBB (GSM) [this message]
2026-07-09 10:53 ` [PATCH v4 5/7] net: wwan: t9xx: Add FSM thread Jack Wu via B4 Relay
2026-07-16 9:34 ` Simon Horman
2026-07-17 7:24 ` [External Mail] " Wu. JackBB (GSM)
2026-07-17 11:02 ` Wu. JackBB (GSM)
2026-07-09 10:53 ` [PATCH v4 6/7] net: wwan: t9xx: Add AT & MBIM WWAN ports Jack Wu via B4 Relay
2026-07-16 9:34 ` Simon Horman
2026-07-17 7:26 ` [External Mail] " Wu. JackBB (GSM)
2026-07-09 10:53 ` [PATCH v4 7/7] net: wwan: t9xx: Add maintainers entry Jack Wu via B4 Relay
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=def80621b7b542008580609735872604@compal.com \
--to=jackbb_wu@compal.com \
--cc=Minano.tseng@mediatek.com \
--cc=andrew+netdev@lunn.ch \
--cc=angelogioacchino.delregno@collabora.com \
--cc=corbet@lwn.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=johannes@sipsolutions.net \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=loic.poulain@oss.qualcomm.com \
--cc=matthias.bgg@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=ryazanov.s.a@gmail.com \
--cc=shi-wei.yeh@mediatek.com \
--cc=skhan@linuxfoundation.org \
--cc=wen-zhi.huang@mediatek.com \
/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