From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id AE51245E1C for ; Tue, 3 Dec 2024 13:31:34 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9229C40264; Tue, 3 Dec 2024 13:31:34 +0100 (CET) Received: from mail-yw1-f172.google.com (mail-yw1-f172.google.com [209.85.128.172]) by mails.dpdk.org (Postfix) with ESMTP id 6BC8340264 for ; Tue, 3 Dec 2024 13:31:33 +0100 (CET) Received: by mail-yw1-f172.google.com with SMTP id 00721157ae682-6ef60e500d7so35641457b3.0 for ; Tue, 03 Dec 2024 04:31:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733229093; x=1733833893; darn=dpdk.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=9z3VQ9zP9mDndZj49OoRQJpZl51iPxxfXyDNG59hCIo=; b=LolkYHrFsRPXyprlBuzXKlQZ9ZS4eVOe1txf1ym+nG52lkDw2riwEHnhJDfQnDaSbE npe26AMXKIcjBtw0P4USklwgp/uhqijvj9lKJyOpnf0xMJ83+POIh0An0JJU4uRV0qNN pXK55gwreYs2EclBBo4svnQtAiGG4DUxq7ZHn6Pf7Ov8WgKYSRZA2wTzg/pM163TBOsa JBWeAZ0bNK9ljsHydgVeEJgpvj1+Of0Us4wUaGy8It/QzDpwWQAI1TIbFZTaBByFiFQA YUZdPYQOOEooYehL9/ZQKVNum/n84AXZshlkSHDPcmJ4a9mYwTb0QBls+jYVPfNN6P+n RgcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733229093; x=1733833893; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=9z3VQ9zP9mDndZj49OoRQJpZl51iPxxfXyDNG59hCIo=; b=CgSnk9k7I/pruvj8MCn5GZ9q6L1hi/Uhq5klFdHQWwDPc/aathUVoyr9YtBvdZozlJ RMQzzCMNaNmFM0mLTNqRQ2rbAQmnwal9WNUR6j7ii5qyGtOBeeiif+mbNLWNPJsRH0IG vYZWEukVBaVQ0ccSp28ZkPVMvvZM6jAHd1ypvaZ9oiNYx8igV5rHNh/yzJ/d7mW3c/xi ZcuaqAgA7IOJO3p+803eYwj0tow8vkWV1Z5Pkv90Lqs0CvFKEA1wNilcTGhEVHdaWCIY ix6tmHHCpMyTUVEI+W5+uGtGCTpEbIGOTJQ2w523kQqfDoN98NQr1Dz6Qo+fs1eZupOx MxYQ== X-Gm-Message-State: AOJu0Yw/A40YTPvaarammve3iMJC5SE3CDJW+NpfnW8nf9X+I+ZrpfhA 3lRd41Ffo/BT8PxIrbvI0zN9zN+ir2Yf/O2lT5nwc+DidM5n0CNjs3T74KG+fGOrWxZk5eG8jeG k8pVcLdM1cuW2vrfjKZY7hlAZjag= X-Gm-Gg: ASbGncvmLPgZI/zTHMKfN+gXH2GFkEqaHBuylwejqcjsUcL9qDF7gA6CvKHUu3EY+Ag lYaH5/gWlAfNdnr1KzCfm6K7ZpFAwYJDTMCt2BPJHCeifLRgRt5jOLtCOSRT4tUavIg== X-Google-Smtp-Source: AGHT+IFcF8/DHFXk3hkVxtjxGQxcJlMf7tIoO3QgDnYPPqA37/PfA3VI6LoN+i1XTjvdECP1XFKZ/JxBofvbhNW7nuE= X-Received: by 2002:a05:690c:2902:b0:6ef:652b:91cf with SMTP id 00721157ae682-6efad2d9546mr26513807b3.27.1733229092726; Tue, 03 Dec 2024 04:31:32 -0800 (PST) MIME-Version: 1.0 References: <20241203064603.217172-1-haijie1@huawei.com> In-Reply-To: <20241203064603.217172-1-haijie1@huawei.com> From: Luca Boccassi Date: Tue, 3 Dec 2024 12:31:20 +0000 Message-ID: Subject: Re: [PATCH 22.11] net/hns3: fix crash for NEON and SVE To: Jie Hai Cc: stable@dpdk.org, Dongdong Liu , Yisen Zhuang , Huisong Li , Chengwen Feng , "Wei Hu (Xavier)" Content-Type: text/plain; charset="UTF-8" X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org On Tue, 3 Dec 2024 at 06:53, Jie Hai wrote: > > From: Huisong Li > > [ 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 > --- > 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