patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Luca Boccassi <luca.boccassi@gmail.com>
To: Jie Hai <haijie1@huawei.com>
Cc: stable@dpdk.org, Dongdong Liu <liudongdong3@huawei.com>,
	 Yisen Zhuang <yisen.zhuang@huawei.com>,
	Huisong Li <lihuisong@huawei.com>,
	 Chengwen Feng <fengchengwen@huawei.com>,
	"Wei Hu (Xavier)" <xavier.huwei@huawei.com>
Subject: Re: [PATCH 22.11] net/hns3: fix crash for NEON and SVE
Date: Tue, 3 Dec 2024 12:31:20 +0000	[thread overview]
Message-ID: <CAMw=ZnSm=3EYpWSwCzGF8fURcrbGTwXYpH1=m2QF6WZVYBwuXw@mail.gmail.com> (raw)
In-Reply-To: <20241203064603.217172-1-haijie1@huawei.com>

On Tue, 3 Dec 2024 at 06:53, Jie Hai <haijie1@huawei.com> wrote:
>
> From: Huisong Li <lihuisong@huawei.com>
>
> [ upstream commit 01843ab2f2fc8c3137258ec39b2cb6f62ba7b8a2 ]
>
> Driver may fail to allocate bulk mbufs for Neon and SVE when rearm
> mbuf. Currently, driver keeps going to handle packets even if there
> isn't available descriptors to receive packets at this moment.
> As a result, driver probably fills the mbufs with invalid data to
> application and accesses to illegal address because of the VLD bit
> of the descriptor at the "rx_rearm_start" position still being set.
> So driver has to clear VLD bit for this descriptor in this scenario
> in case of receiving packets later.
>
> In addition, it is possible that the sum of the "rx_rearm_nb" and
> "rx_rearm_start" is greater than total descriptor number of Rx queue
> in the above scenario. So the index of rxq->sw_ring[] to set mbuf
> pointer to NULL should also be fixed to avoid out-of-bounds memory
> access.
>
> Fixes: a3d4f4d291d7 ("net/hns3: support NEON Rx")
> Fixes: f81a18f49152 ("net/hns3: fix mbuf leakage when RxQ started after reset")
>
> Signed-off-by: Huisong Li <lihuisong@huawei.com>
> ---
>  drivers/net/hns3/hns3_rxtx.c         | 2 +-
>  drivers/net/hns3/hns3_rxtx_vec.c     | 5 +++++
>  drivers/net/hns3/hns3_rxtx_vec_sve.c | 5 +++++
>  3 files changed, 11 insertions(+), 1 deletion(-)

Thanks, applied

      reply	other threads:[~2024-12-03 12:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-03  6:46 Jie Hai
2024-12-03 12:31 ` Luca Boccassi [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='CAMw=ZnSm=3EYpWSwCzGF8fURcrbGTwXYpH1=m2QF6WZVYBwuXw@mail.gmail.com' \
    --to=luca.boccassi@gmail.com \
    --cc=fengchengwen@huawei.com \
    --cc=haijie1@huawei.com \
    --cc=lihuisong@huawei.com \
    --cc=liudongdong3@huawei.com \
    --cc=stable@dpdk.org \
    --cc=xavier.huwei@huawei.com \
    --cc=yisen.zhuang@huawei.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;
as well as URLs for NNTP newsgroup(s).