From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1AFE8A0353; Thu, 30 Apr 2020 20:29:25 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BA1901DB3A; Thu, 30 Apr 2020 20:29:24 +0200 (CEST) Received: from mail-oi1-f193.google.com (mail-oi1-f193.google.com [209.85.167.193]) by dpdk.org (Postfix) with ESMTP id 5780A1DB1B for ; Thu, 30 Apr 2020 20:29:23 +0200 (CEST) Received: by mail-oi1-f193.google.com with SMTP id j16so435035oih.10 for ; Thu, 30 Apr 2020 11:29:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=A0oKwrdPoywbGxNtn7i45pqyFfTS6OpoIpW7JrP+298=; b=P1Ij2xJ7oNXXnU4mh0F0K3wxf9DObofg5/NkBebqlrc6mxs11ErzNOUC1vk2bgvslU sB/t2X4YFSmBGTEhlBK6Fqw0riw+w1wXKLEii1R2xnW5NKmtH116ysuOWFXrwbtKrJTR pKWnN4sR2UVfKa0m9ZCh8AyTIWAHiYynpa5xk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=A0oKwrdPoywbGxNtn7i45pqyFfTS6OpoIpW7JrP+298=; b=L9VWV6otd8aN5NEyqv9YImPe6cysfLWCvlOv5he6XoNqAa76726z7Fr+4k1MwC/Jhw 2M6zdqvvDpxomUSnvyqkG5LfQpR7nWovioOAyE/HWnXRG2Z677RlAUjK/gCIWQjkm8Eo 5GeQnLzBVvnWGAyelnHfRYpORalBPrrIpecaZD2ZKkb+8vjnXjDrTC0V50N3/STneBLM 8N4UUEhtDT0YWpvq36MlGw9NbuBQ6wVXNoWctJ+ZQ/b1ZCC3PFd0CWoOIGM1kbodEejK tZFAWn4/HFJmpVXb1Z0SdCT46frwn3RNAozn3kZxpzPMpNocG/dLObg1vqGyYrwuDNLH PRSw== X-Gm-Message-State: AGi0Pub6ZR0JV/6DnFDI2DkEeCCFVMM4+pMxwF1r8RM1XjqSIBEA4eqt i7FsMn59uA2JeC3s3TNJ69Ypdj4MbGfwzR6hrwYvGA== X-Google-Smtp-Source: APiQypJpZ0klIh/1Uv508wc6XEcczhY60zHC+5kyqCbx547g3fs8yjLlwnLP1GZYjQ4DOLIXA24hLcqjDi4T9D2yAJM= X-Received: by 2002:aca:5583:: with SMTP id j125mr244478oib.179.1588271362404; Thu, 30 Apr 2020 11:29:22 -0700 (PDT) MIME-Version: 1.0 References: <1588253872-19024-1-git-send-email-yuanlinsi01@baidu.com> In-Reply-To: From: Ajit Khaparde Date: Thu, 30 Apr 2020 11:29:06 -0700 Message-ID: To: Lance Richardson Cc: Yuan Linsi , Somnath Kotur , dpdk-dev Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH] net/bnxt: fix a possible stack smashing X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Thu, Apr 30, 2020 at 6:45 AM Lance Richardson < lance.richardson@broadcom.com> wrote: > On Thu, Apr 30, 2020 at 9:37 AM Yuan Linsi wrote: > > > > From: yuanlinsi01 > > > > We see a stack smashing as a result of defensive code missing. Once the > > nb_pkts is less than RTE_BNXT_DESCS_PER_LOOP, it will be modified to > > zero after doing a floor align, and we can not exit the following > > receiving packets loop. And the buffers will be overwrite, then the > > stack frame was ruined. > > > > Fix the problem by adding defensive code, once the nb_pkts is zero, just > > directly return with no packets. > > > > Fixes: bc4a000f2 ("net/bnxt: implement SSE vector mode") > > Cc: stable@dpdk.org > > > > Signed-off-by: yuanlinsi01 > > Signed-off-by: rongdongsheng > > Thanks for the fix! > > Acked-by: Lance Richardson > Patch applied to dpdk-next-net-brcm. Thanks