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 BB422A00BE for ; Mon, 8 Jun 2020 09:50:13 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9D970E07; Mon, 8 Jun 2020 09:50:13 +0200 (CEST) Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by dpdk.org (Postfix) with ESMTP id 861A0E07 for ; Mon, 8 Jun 2020 09:50:12 +0200 (CEST) Received: by mail-wr1-f65.google.com with SMTP id q11so16276591wrp.3 for ; Mon, 08 Jun 2020 00:50:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=GO+7wiX4DF1syIShkGDlTq2rer/hI9yBExQwew/Jx48=; b=URNU1lm6SVK9rmZ3qiXCX1BvRH5LKI+Aha5QVQcFopAP+cA7W9EdWbQbadVugAufA4 hUhqWyp/hVslUeLAROr7ZAluudmAiLodnYNQ1s7ZO4wjwKgsdFw7QGJgLEx6HCGIqQx3 a6CYoykuWRFqnEXkBXb3fIxYJTUM1mGBVJFXaIWdOw75dcVlyR5rqRwmdkZ87nzTX/FN SGOxdlc9r42p/VyXOus9bPMkc2Cih+aI/jVP25h6H5Mbigm1ticKxs4gOkOj52DhowXk hMGpnd179FmDCzRD71bX131A80pg6PNp5qe939aRST3JIQWmj80mooBGyal2EuwTWTJ5 F3/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=GO+7wiX4DF1syIShkGDlTq2rer/hI9yBExQwew/Jx48=; b=BD+bGee83MJzw0eukCtvfYX6fUYH1kO7bxfEqxEkGE6PEVfPX5aCpvuXhvw6fuSqDR EIqcGHxoJ4Mf7Kz861JHYSS8YTP3EvU5i5ctX+3yy4KM3fG7hjeN4LGGot8fRxNDhEQG wmWJikc4gMQJaoncn+wuB/wtNjAkN5RnGZyZ0G3KxAR8NNyi6M2aCgPn73fXI3jzsBrw rF16McaBLq71FJVU1Z1vRmkVaeY723UcL/hhnzF60uLvMkfSpjaHh0YjHGaWVLky/rnJ AN9VITGy6XO5z6c1kA5T33qdfmAy08mvJJy+XKVPRU1L5KaEbA3uAoGHyf3rvjeOlJ3e rpLg== X-Gm-Message-State: AOAM531ZAtDCAlFKo1yOLSviKVmZVkgg5KlpZWDvgU4re3fsopkh7JD+ WFgoqz/Q2myknMC6wXryOhkKFg== X-Google-Smtp-Source: ABdhPJyeuuKF1AYs0VAzAesy4wW56+QRYjNAJXlpwKo2i2ijADYGzsYOKqlJjZzCByfg5NfKpfa97A== X-Received: by 2002:adf:f64e:: with SMTP id x14mr23122792wrp.426.1591602612272; Mon, 08 Jun 2020 00:50:12 -0700 (PDT) Received: from 6wind.com (2a01cb0c0005a600345636f7e65ed1a0.ipv6.abo.wanadoo.fr. [2a01:cb0c:5:a600:3456:36f7:e65e:d1a0]) by smtp.gmail.com with ESMTPSA id o9sm21362907wmh.37.2020.06.08.00.50.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jun 2020 00:50:11 -0700 (PDT) Date: Mon, 8 Jun 2020 09:50:11 +0200 From: Olivier Matz To: Alexander Kozyrev Cc: dev@dpdk.org, stable@dpdk.org, rasland@mellanox.com, viacheslavo@mellanox.com Message-ID: <20200608075011.GN12564@platinum> References: <1591025056-16031-1-git-send-email-akozyrev@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1591025056-16031-1-git-send-email-akozyrev@mellanox.com> User-Agent: Mutt/1.10.1 (2018-07-13) Subject: Re: [dpdk-stable] [PATCH] mbuf: fix external mbufs pool boundaries X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 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 Mon, Jun 01, 2020 at 03:24:16PM +0000, Alexander Kozyrev wrote: > Memzones are created in testpmd in order to test external data > buffers functionality. Each memzone is 2Mb in size and divided among > the pool of external memory buffers. > > Memzone may not always be fully utilized because mbufs size can vary > and some space can be left unused at the tail of a memzone. This is > not handled properly and mbuf can get the address of this leftover > space since this address is still valid (part of memzone), but there > is not enough space to fit the whole packet data. As a result packet > data may overflow and cause the memory corruption. > > Take mbuf size into account when distributing memory addresses from > a memzone to external mbufs. Skip the remaining tail in case there > is not enough room for a packet and move to a next memzone instead. > > Fixes: 6c8e50c2e5 ("mbuf: create pool with external memory buffers") > Cc: stable@dpdk.org > Signed-off-by: Alexander Kozyrev > Acked-by: Viacheslav Ovsiienko Acked-by: Olivier Matz Thanks!