patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@amd.com>
To: Sivaramakrishnan Venkat <venkatx.sivaramakrishnan@intel.com>
Cc: dev@dpdk.org, stable@dpdk.org, gakhil@marvell.com,
	Zyta Szpak <zr@semihalf.com>, Liron Himi <lironh@marvell.com>,
	Gagandeep Singh <g.singh@nxp.com>,
	Hemant Agrawal <hemant.agrawal@nxp.com>,
	Sachin Saxena <sachin.saxena@nxp.com>,
	Chaoyong He <chaoyong.he@corigine.com>
Subject: Re: [PATCH v1] net/tap: fix buffer overflow for ptypes list
Date: Tue, 12 Dec 2023 15:23:09 +0000	[thread overview]
Message-ID: <b93908e6-55ff-43ba-a2a8-bbddbea17a87@amd.com> (raw)
In-Reply-To: <20231212143722.1803259-1-venkatx.sivaramakrishnan@intel.com>

On 12/12/2023 2:37 PM, Sivaramakrishnan Venkat wrote:
> Incorrect ptypes list causes buffer overflow for Address Sanitizer
> run and a tap device. The last element in the ptypes lists to be
> to "RTE_PTYPE_UNKNOWN" for rte_eth_dev_get_supported_ptypes().
> In rte_eth_dev_get_supported_ptypes(), the loop iterates until it
> finds "RTE_PTYPE_UNKNOWN" to detect last element of the ptypes array.
> Fix tap_dev_supported_ptypes_get() method to return correct lists.
> 
> Fixes: 0849ac3b6122 ("net/tap: add packet type management")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Sivaramakrishnan Venkat <venkatx.sivaramakrishnan@intel.com>
> ---
>  drivers/net/tap/rte_eth_tap.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c
> index b41fa971cb..3fa03cdbee 100644
> --- a/drivers/net/tap/rte_eth_tap.c
> +++ b/drivers/net/tap/rte_eth_tap.c
> @@ -1803,6 +1803,7 @@ tap_dev_supported_ptypes_get(struct rte_eth_dev *dev __rte_unused)
>  		RTE_PTYPE_L4_UDP,
>  		RTE_PTYPE_L4_TCP,
>  		RTE_PTYPE_L4_SCTP,
> +		RTE_PTYPE_UNKNOWN
>  	};
>  
>  	return ptypes;

Hi Sivaramakrishnan,

Patch looks good to me, thanks.

But there are multiple drivers have same problem, at least following
ones [1] (maintainers of them cc'ed).

Can you please send a new version that fixes all?


Also as we have already missed multiple ones, perhaps we can add a unit
test to 'app/test/test_ethdev_api.c' for this API.
I think there is no way to make sure if 'RTE_PTYPE_UNKNOWN' is added
(unless you find a way), but we can call the
'rte_eth_dev_get_supported_ptypes()' API and detect any crash in advance.

Can you add this kind of unit test as part of next patch?


[1]
mvneta
mvpp2
pfe
dpaa
nfp

  reply	other threads:[~2023-12-12 15:23 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-12 14:37 Sivaramakrishnan Venkat
2023-12-12 15:23 ` Ferruh Yigit [this message]
2023-12-15 13:38 ` [PATCH v2] " Sivaramakrishnan Venkat
2023-12-15 13:52   ` Ferruh Yigit
2023-12-15 13:55     ` Sivaramakrishnan, VenkatX
2023-12-15 17:21       ` Ferruh Yigit
2023-12-21 18:40 ` [PATCH v3] ethdev: fix getting supported " Sivaramakrishnan Venkat
2023-12-21 21:03   ` Tyler Retzlaff
2023-12-22  8:21   ` David Marchand
2024-01-04 17:51   ` [dpdk-dev v4 2/2] net/tap: fix buffer overflow for " Sivaramakrishnan Venkat
2024-01-04 17:51     ` [dpdk-dev v4 1/2] net/tap: fix buffer overflow for ptypes list through updation of last element Sivaramakrishnan Venkat
2024-01-11 15:11       ` Ferruh Yigit
2024-01-04 17:51     ` [dpdk-dev v4 2/2] net/tap: fix buffer overflow for ptypes list through driver API update Sivaramakrishnan Venkat
2024-01-11 15:12       ` Ferruh Yigit
2024-01-11 16:29       ` Andrew Rybchenko
2024-01-18 12:07 ` [PATCH v5 1/2] drivers/net: fix buffer overflow for ptypes list Sivaramakrishnan Venkat
2024-01-19 14:58   ` Ferruh Yigit
2024-01-19 17:10     ` Power, Ciara
2024-01-22  9:42       ` Ferruh Yigit
2024-01-22  9:46         ` Power, Ciara
2024-01-22 10:03           ` Ferruh Yigit
2024-01-25 16:07 ` [PATCH v6 " Sivaramakrishnan Venkat
2024-02-01 15:43 ` [PATCH v7 " Sivaramakrishnan Venkat
2024-02-01 15:50 ` Sivaramakrishnan Venkat
2024-02-01 22:58   ` Ferruh Yigit
2024-02-01 23:29     ` Ferruh Yigit

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=b93908e6-55ff-43ba-a2a8-bbddbea17a87@amd.com \
    --to=ferruh.yigit@amd.com \
    --cc=chaoyong.he@corigine.com \
    --cc=dev@dpdk.org \
    --cc=g.singh@nxp.com \
    --cc=gakhil@marvell.com \
    --cc=hemant.agrawal@nxp.com \
    --cc=lironh@marvell.com \
    --cc=sachin.saxena@nxp.com \
    --cc=stable@dpdk.org \
    --cc=venkatx.sivaramakrishnan@intel.com \
    --cc=zr@semihalf.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).