* [PATCH] net/i40e: fix dereferencing null pointer
@ 2017-07-27 7:28 Kuba Kozak
2017-07-28 3:29 ` Wu, Jingjing
0 siblings, 1 reply; 3+ messages in thread
From: Kuba Kozak @ 2017-07-27 7:28 UTC (permalink / raw)
To: jingjing.wu; +Cc: dev, deepak.k.jain, michalx.k.jastrzebski, Kuba Kozak, stable
Add check if o_vlan_mask and i_vlan_mask are
not a NULL pointer.
Coverity issue: 143448
Coverity issue: 143449
Fixes: d37705068ee8 ("net/i40e: parse QinQ pattern")
Cc: stable@dpdk.org
Signed-off-by: Kuba Kozak <kubax.kozak@intel.com>
---
drivers/net/i40e/i40e_flow.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c
index 95af701..b92719a 100644
--- a/drivers/net/i40e/i40e_flow.c
+++ b/drivers/net/i40e/i40e_flow.c
@@ -3719,8 +3719,10 @@ i40e_flow_parse_qinq_pattern(__rte_unused struct rte_eth_dev *dev,
}
/* Get filter specification */
- if ((o_vlan_mask->tci == rte_cpu_to_be_16(I40E_TCI_MASK)) &&
- (i_vlan_mask->tci == rte_cpu_to_be_16(I40E_TCI_MASK))) {
+ if ((o_vlan_mask != NULL) && (o_vlan_mask->tci ==
+ rte_cpu_to_be_16(I40E_TCI_MASK)) &&
+ (i_vlan_mask != NULL) &&
+ (i_vlan_mask->tci == rte_cpu_to_be_16(I40E_TCI_MASK))) {
filter->outer_vlan = rte_be_to_cpu_16(o_vlan_spec->tci)
& I40E_TCI_MASK;
filter->inner_vlan = rte_be_to_cpu_16(i_vlan_spec->tci)
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] net/i40e: fix dereferencing null pointer
2017-07-27 7:28 [PATCH] net/i40e: fix dereferencing null pointer Kuba Kozak
@ 2017-07-28 3:29 ` Wu, Jingjing
2017-07-31 13:23 ` [dpdk-stable] " Ferruh Yigit
0 siblings, 1 reply; 3+ messages in thread
From: Wu, Jingjing @ 2017-07-28 3:29 UTC (permalink / raw)
To: Kozak, KubaX; +Cc: dev, Jain, Deepak K, Jastrzebski, MichalX K, stable
> -----Original Message-----
> From: Kozak, KubaX
> Sent: Thursday, July 27, 2017 3:28 PM
> To: Wu, Jingjing <jingjing.wu@intel.com>
> Cc: dev@dpdk.org; Jain, Deepak K <deepak.k.jain@intel.com>; Jastrzebski, MichalX K
> <michalx.k.jastrzebski@intel.com>; Kozak, KubaX <kubax.kozak@intel.com>;
> stable@dpdk.org
> Subject: [PATCH] net/i40e: fix dereferencing null pointer
>
> Add check if o_vlan_mask and i_vlan_mask are
> not a NULL pointer.
>
> Coverity issue: 143448
> Coverity issue: 143449
> Fixes: d37705068ee8 ("net/i40e: parse QinQ pattern")
> Cc: stable@dpdk.org
>
> Signed-off-by: Kuba Kozak <kubax.kozak@intel.com>
> ---
> drivers/net/i40e/i40e_flow.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c
> index 95af701..b92719a 100644
> --- a/drivers/net/i40e/i40e_flow.c
> +++ b/drivers/net/i40e/i40e_flow.c
> @@ -3719,8 +3719,10 @@ i40e_flow_parse_qinq_pattern(__rte_unused struct
> rte_eth_dev *dev,
> }
>
> /* Get filter specification */
> - if ((o_vlan_mask->tci == rte_cpu_to_be_16(I40E_TCI_MASK)) &&
> - (i_vlan_mask->tci == rte_cpu_to_be_16(I40E_TCI_MASK))) {
> + if ((o_vlan_mask != NULL) && (o_vlan_mask->tci ==
> + rte_cpu_to_be_16(I40E_TCI_MASK)) &&
> + (i_vlan_mask != NULL) &&
> + (i_vlan_mask->tci == rte_cpu_to_be_16(I40E_TCI_MASK))) {
> filter->outer_vlan = rte_be_to_cpu_16(o_vlan_spec->tci)
> & I40E_TCI_MASK;
> filter->inner_vlan = rte_be_to_cpu_16(i_vlan_spec->tci)
> --
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Thanks
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-stable] [PATCH] net/i40e: fix dereferencing null pointer
2017-07-28 3:29 ` Wu, Jingjing
@ 2017-07-31 13:23 ` Ferruh Yigit
0 siblings, 0 replies; 3+ messages in thread
From: Ferruh Yigit @ 2017-07-31 13:23 UTC (permalink / raw)
To: Wu, Jingjing, Kozak, KubaX
Cc: dev, Jain, Deepak K, Jastrzebski, MichalX K, stable
On 7/28/2017 4:29 AM, Wu, Jingjing wrote:
>
>
>> -----Original Message-----
>> From: Kozak, KubaX
>> Sent: Thursday, July 27, 2017 3:28 PM
>> To: Wu, Jingjing <jingjing.wu@intel.com>
>> Cc: dev@dpdk.org; Jain, Deepak K <deepak.k.jain@intel.com>; Jastrzebski, MichalX K
>> <michalx.k.jastrzebski@intel.com>; Kozak, KubaX <kubax.kozak@intel.com>;
>> stable@dpdk.org
>> Subject: [PATCH] net/i40e: fix dereferencing null pointer
>>
>> Add check if o_vlan_mask and i_vlan_mask are
>> not a NULL pointer.
>>
>> Coverity issue: 143448
>> Coverity issue: 143449
>> Fixes: d37705068ee8 ("net/i40e: parse QinQ pattern")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Kuba Kozak <kubax.kozak@intel.com>
> Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Applied to dpdk-next-net/master, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-07-31 13:23 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-27 7:28 [PATCH] net/i40e: fix dereferencing null pointer Kuba Kozak
2017-07-28 3:29 ` Wu, Jingjing
2017-07-31 13:23 ` [dpdk-stable] " Ferruh Yigit
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.