[v5,1/2] drivers/net: fix buffer overflow for ptypes list

Message ID 20240118120741.1434286-1-venkatx.sivaramakrishnan@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers
Series [v5,1/2] drivers/net: fix buffer overflow for ptypes list |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-testing warning apply patch failure

Commit Message

Sivaramakrishnan Venkat Jan. 18, 2024, 12:07 p.m. UTC
  Address Sanitizer detects a buffer overflow caused by an incorrect
ptypes list. Missing "RTE_PTYPE_UNKNOWN" ptype causes buffer overflow.
Fix the ptypes list for drivers.

Fixes: 0849ac3b6122 ("net/tap: add packet type management")
Fixes: a7bdc3bd4244 ("net/dpaa: support packet type parsing")
Fixes: 4ccc8d770d3b ("net/mvneta: add PMD skeleton")
Fixes: f3f0d77db6b0 ("net/mrvl: support packet type parsing")
Fixes: 71e8bb65046e ("net/nfp: update supported list of packet types")
Fixes: 659b494d3d88 ("net/pfe: add packet types and basic statistics")
Fixes: 398a1be14168 ("net/thunderx: remove generic passX references")
Cc: pascal.mazon@6wind.com
Cc: shreyansh.jain@nxp.com
Cc: zr@semihalf.com
Cc: tdu@semihalf.com
Cc: qin.ke@corigine.com
Cc: g.singh@nxp.com
Cc: jerin.jacob@caviumnetworks.com
Cc: stable@dpdk.org

Signed-off-by: Sivaramakrishnan Venkat <venkatx.sivaramakrishnan@intel.com>

--
v5: modified commit message.
v4: split into two patches, one for backporting and one for upstream rework
v3: reworked the function to return number of elements and remove the need
    for RTE_PTYPE_UNKNOWN in list.
v2: extended fix for multiple drivers.
---
 drivers/net/dpaa/dpaa_ethdev.c      | 3 ++-
 drivers/net/mvneta/mvneta_ethdev.c  | 3 ++-
 drivers/net/mvpp2/mrvl_ethdev.c     | 3 ++-
 drivers/net/nfp/nfp_net_common.c    | 1 +
 drivers/net/pfe/pfe_ethdev.c        | 3 ++-
 drivers/net/tap/rte_eth_tap.c       | 1 +
 drivers/net/thunderx/nicvf_ethdev.c | 2 ++
 7 files changed, 12 insertions(+), 4 deletions(-)
  

Comments

Ferruh Yigit Jan. 19, 2024, 2:58 p.m. UTC | #1
On 1/18/2024 12:07 PM, Sivaramakrishnan Venkat wrote:
> Address Sanitizer detects a buffer overflow caused by an incorrect
> ptypes list. Missing "RTE_PTYPE_UNKNOWN" ptype causes buffer overflow.
> Fix the ptypes list for drivers.
> 
> Fixes: 0849ac3b6122 ("net/tap: add packet type management")
> Fixes: a7bdc3bd4244 ("net/dpaa: support packet type parsing")
> Fixes: 4ccc8d770d3b ("net/mvneta: add PMD skeleton")
> Fixes: f3f0d77db6b0 ("net/mrvl: support packet type parsing")
> Fixes: 71e8bb65046e ("net/nfp: update supported list of packet types")
> Fixes: 659b494d3d88 ("net/pfe: add packet types and basic statistics")
> Fixes: 398a1be14168 ("net/thunderx: remove generic passX references")
> Cc: pascal.mazon@6wind.com
> Cc: shreyansh.jain@nxp.com
> Cc: zr@semihalf.com
> Cc: tdu@semihalf.com
> Cc: qin.ke@corigine.com
> Cc: g.singh@nxp.com
> Cc: jerin.jacob@caviumnetworks.com
> Cc: stable@dpdk.org
> 
> Signed-off-by: Sivaramakrishnan Venkat <venkatx.sivaramakrishnan@intel.com>
>

Reviewed-by: Ferruh Yigit <ferruh.yigit@amd.com>


("Cc: <email>" shouldn't be in the commit message, but not big deal I
can remove them while merging.
If you want to help, in next version please put them after '---', as you
are already doing with changelog)
  
Power, Ciara Jan. 19, 2024, 5:10 p.m. UTC | #2
Hi Ferruh,

> -----Original Message-----
> From: Ferruh Yigit <ferruh.yigit@amd.com>
> Sent: Friday, January 19, 2024 2:59 PM
> To: Sivaramakrishnan, VenkatX <venkatx.sivaramakrishnan@intel.com>;
> Hemant Agrawal <hemant.agrawal@nxp.com>; Sachin Saxena
> <sachin.saxena@nxp.com>; Zyta Szpak <zr@semihalf.com>; Liron Himi
> <lironh@marvell.com>; Chaoyong He <chaoyong.he@corigine.com>;
> Gagandeep Singh <g.singh@nxp.com>; Jerin Jacob <jerinj@marvell.com>;
> Maciej Czekaj <mczekaj@marvell.com>
> Cc: dev@dpdk.org; Power, Ciara <ciara.power@intel.com>;
> pascal.mazon@6wind.com; shreyansh.jain@nxp.com; tdu@semihalf.com;
> qin.ke@corigine.com; jerin.jacob@caviumnetworks.com; stable@dpdk.org
> Subject: Re: [PATCH v5 1/2] drivers/net: fix buffer overflow for ptypes list
> 
> On 1/18/2024 12:07 PM, Sivaramakrishnan Venkat wrote:
> > Address Sanitizer detects a buffer overflow caused by an incorrect
> > ptypes list. Missing "RTE_PTYPE_UNKNOWN" ptype causes buffer overflow.
> > Fix the ptypes list for drivers.
> >
> > Fixes: 0849ac3b6122 ("net/tap: add packet type management")
> > Fixes: a7bdc3bd4244 ("net/dpaa: support packet type parsing")
> > Fixes: 4ccc8d770d3b ("net/mvneta: add PMD skeleton")
> > Fixes: f3f0d77db6b0 ("net/mrvl: support packet type parsing")
> > Fixes: 71e8bb65046e ("net/nfp: update supported list of packet types")
> > Fixes: 659b494d3d88 ("net/pfe: add packet types and basic statistics")
> > Fixes: 398a1be14168 ("net/thunderx: remove generic passX references")
> > Cc: pascal.mazon@6wind.com
> > Cc: shreyansh.jain@nxp.com
> > Cc: zr@semihalf.com
> > Cc: tdu@semihalf.com
> > Cc: qin.ke@corigine.com
> > Cc: g.singh@nxp.com
> > Cc: jerin.jacob@caviumnetworks.com
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Sivaramakrishnan Venkat
> > <venkatx.sivaramakrishnan@intel.com>
> >
> 
> Reviewed-by: Ferruh Yigit <ferruh.yigit@amd.com>
> 
> 
> ("Cc: <email>" shouldn't be in the commit message, but not big deal I can
> remove them while merging.
> If you want to help, in next version please put them after '---', as you are
> already doing with changelog)

Thanks for the review on this one.

The DPDK docs suggest adding the Fixes line + CC in the commit message body - has the guidelines changed for this?
We can update in the next version if that is preferred here though, no problem.

Thanks,
Ciara
  
Ferruh Yigit Jan. 22, 2024, 9:42 a.m. UTC | #3
On 1/19/2024 5:10 PM, Power, Ciara wrote:
> Hi Ferruh,
> 
>> -----Original Message-----
>> From: Ferruh Yigit <ferruh.yigit@amd.com>
>> Sent: Friday, January 19, 2024 2:59 PM
>> To: Sivaramakrishnan, VenkatX <venkatx.sivaramakrishnan@intel.com>;
>> Hemant Agrawal <hemant.agrawal@nxp.com>; Sachin Saxena
>> <sachin.saxena@nxp.com>; Zyta Szpak <zr@semihalf.com>; Liron Himi
>> <lironh@marvell.com>; Chaoyong He <chaoyong.he@corigine.com>;
>> Gagandeep Singh <g.singh@nxp.com>; Jerin Jacob <jerinj@marvell.com>;
>> Maciej Czekaj <mczekaj@marvell.com>
>> Cc: dev@dpdk.org; Power, Ciara <ciara.power@intel.com>;
>> pascal.mazon@6wind.com; shreyansh.jain@nxp.com; tdu@semihalf.com;
>> qin.ke@corigine.com; jerin.jacob@caviumnetworks.com; stable@dpdk.org
>> Subject: Re: [PATCH v5 1/2] drivers/net: fix buffer overflow for ptypes list
>>
>> On 1/18/2024 12:07 PM, Sivaramakrishnan Venkat wrote:
>>> Address Sanitizer detects a buffer overflow caused by an incorrect
>>> ptypes list. Missing "RTE_PTYPE_UNKNOWN" ptype causes buffer overflow.
>>> Fix the ptypes list for drivers.
>>>
>>> Fixes: 0849ac3b6122 ("net/tap: add packet type management")
>>> Fixes: a7bdc3bd4244 ("net/dpaa: support packet type parsing")
>>> Fixes: 4ccc8d770d3b ("net/mvneta: add PMD skeleton")
>>> Fixes: f3f0d77db6b0 ("net/mrvl: support packet type parsing")
>>> Fixes: 71e8bb65046e ("net/nfp: update supported list of packet types")
>>> Fixes: 659b494d3d88 ("net/pfe: add packet types and basic statistics")
>>> Fixes: 398a1be14168 ("net/thunderx: remove generic passX references")
>>> Cc: pascal.mazon@6wind.com
>>> Cc: shreyansh.jain@nxp.com
>>> Cc: zr@semihalf.com
>>> Cc: tdu@semihalf.com
>>> Cc: qin.ke@corigine.com
>>> Cc: g.singh@nxp.com
>>> Cc: jerin.jacob@caviumnetworks.com
>>> Cc: stable@dpdk.org
>>>
>>> Signed-off-by: Sivaramakrishnan Venkat
>>> <venkatx.sivaramakrishnan@intel.com>
>>>
>>
>> Reviewed-by: Ferruh Yigit <ferruh.yigit@amd.com>
>>
>>
>> ("Cc: <email>" shouldn't be in the commit message, but not big deal I can
>> remove them while merging.
>> If you want to help, in next version please put them after '---', as you are
>> already doing with changelog)
> 
> Thanks for the review on this one.
> 
> The DPDK docs suggest adding the Fixes line + CC in the commit message body - has the guidelines changed for this?
>

Can you please point me the mentioned doc, let me check it?
  
Power, Ciara Jan. 22, 2024, 9:46 a.m. UTC | #4
Hi Ferruh,

> -----Original Message-----
> From: Ferruh Yigit <ferruh.yigit@amd.com>
> Sent: Monday, January 22, 2024 9:43 AM
> To: Power, Ciara <ciara.power@intel.com>; Sivaramakrishnan, VenkatX
> <venkatx.sivaramakrishnan@intel.com>; Hemant Agrawal
> <hemant.agrawal@nxp.com>; Sachin Saxena <sachin.saxena@nxp.com>; Zyta
> Szpak <zr@semihalf.com>; Liron Himi <lironh@marvell.com>; Chaoyong He
> <chaoyong.he@corigine.com>; Gagandeep Singh <g.singh@nxp.com>; Jerin
> Jacob <jerinj@marvell.com>; Maciej Czekaj <mczekaj@marvell.com>
> Cc: dev@dpdk.org; pascal.mazon@6wind.com; shreyansh.jain@nxp.com;
> tdu@semihalf.com; qin.ke@corigine.com; jerin.jacob@caviumnetworks.com;
> stable@dpdk.org
> Subject: Re: [PATCH v5 1/2] drivers/net: fix buffer overflow for ptypes list
> 
> On 1/19/2024 5:10 PM, Power, Ciara wrote:
> > Hi Ferruh,
> >
> >> -----Original Message-----
> >> From: Ferruh Yigit <ferruh.yigit@amd.com>
> >> Sent: Friday, January 19, 2024 2:59 PM
> >> To: Sivaramakrishnan, VenkatX <venkatx.sivaramakrishnan@intel.com>;
> >> Hemant Agrawal <hemant.agrawal@nxp.com>; Sachin Saxena
> >> <sachin.saxena@nxp.com>; Zyta Szpak <zr@semihalf.com>; Liron Himi
> >> <lironh@marvell.com>; Chaoyong He <chaoyong.he@corigine.com>;
> >> Gagandeep Singh <g.singh@nxp.com>; Jerin Jacob <jerinj@marvell.com>;
> >> Maciej Czekaj <mczekaj@marvell.com>
> >> Cc: dev@dpdk.org; Power, Ciara <ciara.power@intel.com>;
> >> pascal.mazon@6wind.com; shreyansh.jain@nxp.com; tdu@semihalf.com;
> >> qin.ke@corigine.com; jerin.jacob@caviumnetworks.com; stable@dpdk.org
> >> Subject: Re: [PATCH v5 1/2] drivers/net: fix buffer overflow for
> >> ptypes list
> >>
> >> On 1/18/2024 12:07 PM, Sivaramakrishnan Venkat wrote:
> >>> Address Sanitizer detects a buffer overflow caused by an incorrect
> >>> ptypes list. Missing "RTE_PTYPE_UNKNOWN" ptype causes buffer
> overflow.
> >>> Fix the ptypes list for drivers.
> >>>
> >>> Fixes: 0849ac3b6122 ("net/tap: add packet type management")
> >>> Fixes: a7bdc3bd4244 ("net/dpaa: support packet type parsing")
> >>> Fixes: 4ccc8d770d3b ("net/mvneta: add PMD skeleton")
> >>> Fixes: f3f0d77db6b0 ("net/mrvl: support packet type parsing")
> >>> Fixes: 71e8bb65046e ("net/nfp: update supported list of packet
> >>> types")
> >>> Fixes: 659b494d3d88 ("net/pfe: add packet types and basic
> >>> statistics")
> >>> Fixes: 398a1be14168 ("net/thunderx: remove generic passX
> >>> references")
> >>> Cc: pascal.mazon@6wind.com
> >>> Cc: shreyansh.jain@nxp.com
> >>> Cc: zr@semihalf.com
> >>> Cc: tdu@semihalf.com
> >>> Cc: qin.ke@corigine.com
> >>> Cc: g.singh@nxp.com
> >>> Cc: jerin.jacob@caviumnetworks.com
> >>> Cc: stable@dpdk.org
> >>>
> >>> Signed-off-by: Sivaramakrishnan Venkat
> >>> <venkatx.sivaramakrishnan@intel.com>
> >>>
> >>
> >> Reviewed-by: Ferruh Yigit <ferruh.yigit@amd.com>
> >>
> >>
> >> ("Cc: <email>" shouldn't be in the commit message, but not big deal I
> >> can remove them while merging.
> >> If you want to help, in next version please put them after '---', as
> >> you are already doing with changelog)
> >
> > Thanks for the review on this one.
> >
> > The DPDK docs suggest adding the Fixes line + CC in the commit message
> body - has the guidelines changed for this?
> >
> 
> Can you please point me the mentioned doc, let me check it?

Sure, it's in section 8.7 here: https://doc.dpdk.org/guides/contributing/patches.html 

Thanks,
Ciara
  
Ferruh Yigit Jan. 22, 2024, 10:03 a.m. UTC | #5
On 1/22/2024 9:46 AM, Power, Ciara wrote:
> Hi Ferruh,
> 
>> -----Original Message-----
>> From: Ferruh Yigit <ferruh.yigit@amd.com>
>> Sent: Monday, January 22, 2024 9:43 AM
>> To: Power, Ciara <ciara.power@intel.com>; Sivaramakrishnan, VenkatX
>> <venkatx.sivaramakrishnan@intel.com>; Hemant Agrawal
>> <hemant.agrawal@nxp.com>; Sachin Saxena <sachin.saxena@nxp.com>; Zyta
>> Szpak <zr@semihalf.com>; Liron Himi <lironh@marvell.com>; Chaoyong He
>> <chaoyong.he@corigine.com>; Gagandeep Singh <g.singh@nxp.com>; Jerin
>> Jacob <jerinj@marvell.com>; Maciej Czekaj <mczekaj@marvell.com>
>> Cc: dev@dpdk.org; pascal.mazon@6wind.com; shreyansh.jain@nxp.com;
>> tdu@semihalf.com; qin.ke@corigine.com; jerin.jacob@caviumnetworks.com;
>> stable@dpdk.org
>> Subject: Re: [PATCH v5 1/2] drivers/net: fix buffer overflow for ptypes list
>>
>> On 1/19/2024 5:10 PM, Power, Ciara wrote:
>>> Hi Ferruh,
>>>
>>>> -----Original Message-----
>>>> From: Ferruh Yigit <ferruh.yigit@amd.com>
>>>> Sent: Friday, January 19, 2024 2:59 PM
>>>> To: Sivaramakrishnan, VenkatX <venkatx.sivaramakrishnan@intel.com>;
>>>> Hemant Agrawal <hemant.agrawal@nxp.com>; Sachin Saxena
>>>> <sachin.saxena@nxp.com>; Zyta Szpak <zr@semihalf.com>; Liron Himi
>>>> <lironh@marvell.com>; Chaoyong He <chaoyong.he@corigine.com>;
>>>> Gagandeep Singh <g.singh@nxp.com>; Jerin Jacob <jerinj@marvell.com>;
>>>> Maciej Czekaj <mczekaj@marvell.com>
>>>> Cc: dev@dpdk.org; Power, Ciara <ciara.power@intel.com>;
>>>> pascal.mazon@6wind.com; shreyansh.jain@nxp.com; tdu@semihalf.com;
>>>> qin.ke@corigine.com; jerin.jacob@caviumnetworks.com; stable@dpdk.org
>>>> Subject: Re: [PATCH v5 1/2] drivers/net: fix buffer overflow for
>>>> ptypes list
>>>>
>>>> On 1/18/2024 12:07 PM, Sivaramakrishnan Venkat wrote:
>>>>> Address Sanitizer detects a buffer overflow caused by an incorrect
>>>>> ptypes list. Missing "RTE_PTYPE_UNKNOWN" ptype causes buffer
>> overflow.
>>>>> Fix the ptypes list for drivers.
>>>>>
>>>>> Fixes: 0849ac3b6122 ("net/tap: add packet type management")
>>>>> Fixes: a7bdc3bd4244 ("net/dpaa: support packet type parsing")
>>>>> Fixes: 4ccc8d770d3b ("net/mvneta: add PMD skeleton")
>>>>> Fixes: f3f0d77db6b0 ("net/mrvl: support packet type parsing")
>>>>> Fixes: 71e8bb65046e ("net/nfp: update supported list of packet
>>>>> types")
>>>>> Fixes: 659b494d3d88 ("net/pfe: add packet types and basic
>>>>> statistics")
>>>>> Fixes: 398a1be14168 ("net/thunderx: remove generic passX
>>>>> references")
>>>>> Cc: pascal.mazon@6wind.com
>>>>> Cc: shreyansh.jain@nxp.com
>>>>> Cc: zr@semihalf.com
>>>>> Cc: tdu@semihalf.com
>>>>> Cc: qin.ke@corigine.com
>>>>> Cc: g.singh@nxp.com
>>>>> Cc: jerin.jacob@caviumnetworks.com
>>>>> Cc: stable@dpdk.org
>>>>>
>>>>> Signed-off-by: Sivaramakrishnan Venkat
>>>>> <venkatx.sivaramakrishnan@intel.com>
>>>>>
>>>>
>>>> Reviewed-by: Ferruh Yigit <ferruh.yigit@amd.com>
>>>>
>>>>
>>>> ("Cc: <email>" shouldn't be in the commit message, but not big deal I
>>>> can remove them while merging.
>>>> If you want to help, in next version please put them after '---', as
>>>> you are already doing with changelog)
>>>
>>> Thanks for the review on this one.
>>>
>>> The DPDK docs suggest adding the Fixes line + CC in the commit message
>> body - has the guidelines changed for this?
>>>
>>
>> Can you please point me the mentioned doc, let me check it?
> 
> Sure, it's in section 8.7 here: https://doc.dpdk.org/guides/contributing/patches.html 
> 
> 

Right, Cc the author of the fix added later to the 'git fixline' alias,
this is useful because 'git send-email' picks "Cc: ..." and cc the
author to the patch.
But this info is redundant in the commit log, so maintainers are
removing it from commit log while merging.

If the "Cc: ...", is after the '---', it is still picked by 'git
send-email' and removed automatically while merging, so this is better
option.

It is possible to update documentation but I am concerned to make adding
fixline more complex for new contributors. Perhaps can add a new line as
a suggestion.

But briefly, if you move after '---' it helps.
  

Patch

diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c
index ef4c06db6a..779bdc5860 100644
--- a/drivers/net/dpaa/dpaa_ethdev.c
+++ b/drivers/net/dpaa/dpaa_ethdev.c
@@ -363,7 +363,8 @@  dpaa_supported_ptypes_get(struct rte_eth_dev *dev)
 		RTE_PTYPE_L4_TCP,
 		RTE_PTYPE_L4_UDP,
 		RTE_PTYPE_L4_SCTP,
-		RTE_PTYPE_TUNNEL_ESP
+		RTE_PTYPE_TUNNEL_ESP,
+		RTE_PTYPE_UNKNOWN
 	};
 
 	PMD_INIT_FUNC_TRACE();
diff --git a/drivers/net/mvneta/mvneta_ethdev.c b/drivers/net/mvneta/mvneta_ethdev.c
index daa69e533a..212c300c14 100644
--- a/drivers/net/mvneta/mvneta_ethdev.c
+++ b/drivers/net/mvneta/mvneta_ethdev.c
@@ -198,7 +198,8 @@  mvneta_dev_supported_ptypes_get(struct rte_eth_dev *dev __rte_unused)
 		RTE_PTYPE_L3_IPV4,
 		RTE_PTYPE_L3_IPV6,
 		RTE_PTYPE_L4_TCP,
-		RTE_PTYPE_L4_UDP
+		RTE_PTYPE_L4_UDP,
+		RTE_PTYPE_UNKNOWN
 	};
 
 	return ptypes;
diff --git a/drivers/net/mvpp2/mrvl_ethdev.c b/drivers/net/mvpp2/mrvl_ethdev.c
index c12364941d..4cc64c7cad 100644
--- a/drivers/net/mvpp2/mrvl_ethdev.c
+++ b/drivers/net/mvpp2/mrvl_ethdev.c
@@ -1777,7 +1777,8 @@  mrvl_dev_supported_ptypes_get(struct rte_eth_dev *dev __rte_unused)
 		RTE_PTYPE_L3_IPV6_EXT,
 		RTE_PTYPE_L2_ETHER_ARP,
 		RTE_PTYPE_L4_TCP,
-		RTE_PTYPE_L4_UDP
+		RTE_PTYPE_L4_UDP,
+		RTE_PTYPE_UNKNOWN
 	};
 
 	return ptypes;
diff --git a/drivers/net/nfp/nfp_net_common.c b/drivers/net/nfp/nfp_net_common.c
index e969b840d6..46d0e07850 100644
--- a/drivers/net/nfp/nfp_net_common.c
+++ b/drivers/net/nfp/nfp_net_common.c
@@ -1299,6 +1299,7 @@  nfp_net_supported_ptypes_get(struct rte_eth_dev *dev)
 		RTE_PTYPE_INNER_L4_NONFRAG,
 		RTE_PTYPE_INNER_L4_ICMP,
 		RTE_PTYPE_INNER_L4_SCTP,
+		RTE_PTYPE_UNKNOWN
 	};
 
 	if (dev->rx_pkt_burst != nfp_net_recv_pkts)
diff --git a/drivers/net/pfe/pfe_ethdev.c b/drivers/net/pfe/pfe_ethdev.c
index 551f3cf193..0073dd7405 100644
--- a/drivers/net/pfe/pfe_ethdev.c
+++ b/drivers/net/pfe/pfe_ethdev.c
@@ -520,7 +520,8 @@  pfe_supported_ptypes_get(struct rte_eth_dev *dev)
 		RTE_PTYPE_L3_IPV6_EXT,
 		RTE_PTYPE_L4_TCP,
 		RTE_PTYPE_L4_UDP,
-		RTE_PTYPE_L4_SCTP
+		RTE_PTYPE_L4_SCTP,
+		RTE_PTYPE_UNKNOWN
 	};
 
 	if (dev->rx_pkt_burst == pfe_recv_pkts ||
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;
diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c
index a504d41dfe..5a0c3dc4a6 100644
--- a/drivers/net/thunderx/nicvf_ethdev.c
+++ b/drivers/net/thunderx/nicvf_ethdev.c
@@ -392,12 +392,14 @@  nicvf_dev_supported_ptypes_get(struct rte_eth_dev *dev)
 		RTE_PTYPE_L4_TCP,
 		RTE_PTYPE_L4_UDP,
 		RTE_PTYPE_L4_FRAG,
+		RTE_PTYPE_UNKNOWN
 	};
 	static const uint32_t ptypes_tunnel[] = {
 		RTE_PTYPE_TUNNEL_GRE,
 		RTE_PTYPE_TUNNEL_GENEVE,
 		RTE_PTYPE_TUNNEL_VXLAN,
 		RTE_PTYPE_TUNNEL_NVGRE,
+		RTE_PTYPE_UNKNOWN
 	};
 	static const uint32_t ptypes_end = RTE_PTYPE_UNKNOWN;