Netdev List
 help / color / mirror / Atom feed
From: Fan Gong <gongfan1@huawei.com>
To: <xuanqiang.luo@linux.dev>
Cc: <andrew+netdev@lunn.ch>, <davem@davemloft.net>,
	<edumazet@google.com>, <gongfan1@huawei.com>,
	<guoxin09@huawei.com>, <gur.stavi@huawei.com>, <kuba@kernel.org>,
	<linux-kernel@vger.kernel.org>, <luoxuanqiang@kylinos.cn>,
	<netdev@vger.kernel.org>, <pabeni@redhat.com>,
	<stable@vger.kernel.org>, <wudi234@huawei.com>,
	<tengpeisen@huawei.com>, <shijing34@huawei.com>,
	<wulike1@huawei.com>, <chiqijun@huawei.com>,
	<ducheng11@hisilicon.com>
Subject: Re: [PATCH net v1 2/3] hinic3: fix use-after-free on DMA mapping failure
Date: Mon, 20 Jul 2026 21:36:23 +0800	[thread overview]
Message-ID: <20260720133623.717-1-gongfan1@huawei.com> (raw)
In-Reply-To: <20260710090527.58354-3-xuanqiang.luo@linux.dev>

>  drivers/net/ethernet/huawei/hinic3/hinic3_tx.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/huawei/hinic3/hinic3_tx.c b/drivers/net/ethernet/huawei/hinic3/hinic3_tx.c
> index 9306bf0020caf..5739ecb08d0d3 100644
> --- a/drivers/net/ethernet/huawei/hinic3/hinic3_tx.c
> +++ b/drivers/net/ethernet/huawei/hinic3/hinic3_tx.c
> @@ -578,8 +578,6 @@ static netdev_tx_t hinic3_send_one_skb(struct sk_buff *skb,
>  		*wqe_combo.task = task;
>
>  	tx_info = &txq->tx_info[pi];
> -	tx_info->skb = skb;
> -	tx_info->wqebb_cnt = wqebb_cnt;
>
>  	err = hinic3_tx_map_skb(netdev, skb, txq, tx_info, &wqe_combo);
>  	if (err) {
> @@ -589,6 +587,9 @@ static netdev_tx_t hinic3_send_one_skb(struct sk_buff *skb,
>  		goto err_drop_pkt;
>  	}
>
> +	tx_info->skb = skb;
> +	tx_info->wqebb_cnt = wqebb_cnt;
> +
>  	netif_subqueue_sent(netdev, txq->sq->q_id, skb->len);
>  	netif_subqueue_maybe_stop(netdev, txq->sq->q_id,
>  				  hinic3_wq_free_wqebbs(&txq->sq->wq),

Thanks for your fixes, the proposed modification of the hinic3 driver has been
tested on hardware, and it works fine.

Reviewed-by: Fan Gong <gongfan1@huawei.com>

  reply	other threads:[~2026-07-20 13:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-10  9:05 [PATCH net v1 0/3] net: fix stale TX skb pointers on DMA map failure xuanqiang.luo
2026-07-10  9:05 ` [PATCH net v1 1/3] bna: fix use-after-free on DMA mapping failure xuanqiang.luo
2026-07-10  9:05 ` [PATCH net v1 2/3] hinic3: " xuanqiang.luo
2026-07-20 13:36   ` Fan Gong [this message]
2026-07-10  9:05 ` [PATCH net v1 3/3] net: hibmcge: fix double-free of tx skb " xuanqiang.luo
2026-07-10 10:15   ` Jijie Shao
2026-07-16 12:00 ` [PATCH net v1 0/3] net: fix stale TX skb pointers on DMA map failure Simon Horman

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=20260720133623.717-1-gongfan1@huawei.com \
    --to=gongfan1@huawei.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=chiqijun@huawei.com \
    --cc=davem@davemloft.net \
    --cc=ducheng11@hisilicon.com \
    --cc=edumazet@google.com \
    --cc=guoxin09@huawei.com \
    --cc=gur.stavi@huawei.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luoxuanqiang@kylinos.cn \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=shijing34@huawei.com \
    --cc=stable@vger.kernel.org \
    --cc=tengpeisen@huawei.com \
    --cc=wudi234@huawei.com \
    --cc=wulike1@huawei.com \
    --cc=xuanqiang.luo@linux.dev \
    /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