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 A7C2DA0C4B for ; Fri, 15 Oct 2021 11:25:30 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 892A640041; Fri, 15 Oct 2021 11:25:30 +0200 (CEST) Received: from mail-ua1-f45.google.com (mail-ua1-f45.google.com [209.85.222.45]) by mails.dpdk.org (Postfix) with ESMTP id 4D66140041 for ; Fri, 15 Oct 2021 11:25:29 +0200 (CEST) Received: by mail-ua1-f45.google.com with SMTP id e10so12064932uab.3 for ; Fri, 15 Oct 2021 02:25:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smartx-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=y9R8KO/xEF2YI94cLWLx5tJb4tNypdgqNoPYOmoB0F0=; b=zPqmV4Zu0juQEvOIyGyWRJaU2QEM93EEjTqHigYt8wvXxvD6XClUW+SCJpnqHMnXWV gOVBB/MPcTD7kodIM1wG8lf65C8FnX++CgHJMYP1g2Jg47rVgLGRCUAg7X6qv+ozhaYo DJkbhIDbXGNTPqhfJOb7NfhokEud8pB8mE/ArkNEuWp/ZzfDE2HY0N70WUum9WUsc2dp JjJDlCghCa0OzfvaMXWowD/1fiWtRHmTfn/SoZ18AhRAcxux6zFvYONfkvnZeknoWAx4 X5ECr15WSU/P/aqEXGIpJ4F98GAhEPYgu7e+SrqviP7eV8WAHKE2rzWpk8VlZxjqSDUp 7h5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=y9R8KO/xEF2YI94cLWLx5tJb4tNypdgqNoPYOmoB0F0=; b=kZ43XUPSoJyvxLIWan+0cnhw6Y8okjLQwLjDOacar8PSogTl1swsZQXGCrcdJxgbAb LpTpUA+6yTxREWR+g0AkIH6Uad+gx3CJAH4xnEqxYRfw8V/all6wBNIg9po1kAr1q93A X/C42E3wJZQAfd2Q8q3OHBcgNNt71NbB+Fb+xG6Gfwxo4NqClPIO7ljZcCDjcbDc6UIK f7nS7oPDdN1Q7oOGJZkSEyqxl/r4ORiFJk5rEBCsJ5burwpR+3XeTjybJ+KsJRJQlzZK iENV+rcPJSvDxnMIPC3iyjr3mhxlpy4FXUOphCXWkHNyqT6eT3T9pvNxJ3vR/WCZkdDX CUYA== X-Gm-Message-State: AOAM531V7MjwB6zHcORJT1Al5lLHmKTxK1euM9rw86WfBw1jL5xp0vLr PF9QuqDYFNabft/E21PmVqQlYGgn4BMxt3d3XrLY3w== X-Google-Smtp-Source: ABdhPJwfjjCMJ7nPi7UWeRpJEc5JPjDnjqRVAc1sj1GVj0NLKrXDbGcguwSj7WCMllRqvtmUHXJbpaGYs5Gia56Bxko= X-Received: by 2002:a67:fdd3:: with SMTP id l19mr12455697vsq.37.1634289928661; Fri, 15 Oct 2021 02:25:28 -0700 (PDT) MIME-Version: 1.0 References: <20210827051241.2448098-1-fengli@smartx.com> <20211014124008.3570044-1-fengli@smartx.com> <93f2ee9b-d207-c6ce-d79f-55306fd8b8f4@redhat.com> In-Reply-To: <93f2ee9b-d207-c6ce-d79f-55306fd8b8f4@redhat.com> From: Li Feng Date: Fri, 15 Oct 2021 17:25:16 +0800 Message-ID: To: Maxime Coquelin Cc: Chenbo Xia , Lin Li , Jin Yu , Yu Zhang , Xun Ni , dev@dpdk.org, stable@dpdk.org Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH v2] vhost: add sanity check when operating the split ring 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 Sender: "stable" On Fri, Oct 15, 2021 at 4:52 PM Maxime Coquelin wrote: > > The title is too vague, I would put something like: > > vhost: add sanity check on inflight last index > > On 10/14/21 14:40, Li Feng wrote: > > The idx in rte_vhost_set_last_inflight_io_split is from the frontend > > s/idx/index/ > > > driver, check if it's in the virtqueue range. > > > > Fixes: bb0c2de9602b ("vhost: add APIs to operate inflight ring") > > Cc: stable@dpdk.org > > > > Signed-off-by: Li Feng > > --- > > lib/vhost/vhost.c | 3 +++ > > 1 file changed, 3 insertions(+) > > > > diff --git a/lib/vhost/vhost.c b/lib/vhost/vhost.c > > index 9540522dac..3b674ac320 100644 > > --- a/lib/vhost/vhost.c > > +++ b/lib/vhost/vhost.c > > @@ -1226,6 +1226,9 @@ rte_vhost_set_last_inflight_io_split(int vid, uint16_t vring_idx, > > if (unlikely(!vq->inflight_split)) > > return -1; > > > > + if (unlikely(idx >= vq->size)) > > + return -1; > > + > > vq->inflight_split->last_inflight_io = idx; > > return 0; > > } > > > > Other than that, this is fine to me: > > Reviewed-by: Maxime Coquelin > > If my suggestions are fine for you, I can fix while applying. > It's fine. > Thanks, > Maxime >