All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][next] net/mlx5: fix kvfree of uninitialized pointer spec
@ 2019-11-05 18:27 ` Colin King
  0 siblings, 0 replies; 4+ messages in thread
From: Colin King @ 2019-11-05 18:27 UTC (permalink / raw)
  To: Saeed Mahameed, Leon Romanovsky, David S . Miller, Parav Pandit,
	netdev, linux-rdma
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Currently when a call to  esw_vport_create_legacy_ingress_acl_group
fails the error exit path to label 'out' will cause a kvfree on the
uninitialized pointer spec.  Fix this by ensuring pointer spec is
initialized to NULL to avoid this issue.

Addresses-Coverity: ("Uninitialized pointer read")
Fixes: 10652f39943e ("net/mlx5: Refactor ingress acl configuration")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/eswitch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
index 7baade9e62b7..f2e400a23a59 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
@@ -1253,7 +1253,7 @@ static int esw_vport_ingress_config(struct mlx5_eswitch *esw,
 	struct mlx5_flow_destination drop_ctr_dst = {0};
 	struct mlx5_flow_destination *dst = NULL;
 	struct mlx5_flow_act flow_act = {0};
-	struct mlx5_flow_spec *spec;
+	struct mlx5_flow_spec *spec = NULL;
 	int dest_num = 0;
 	int err = 0;
 	u8 *smac_v;
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH][next] net/mlx5: fix kvfree of uninitialized pointer spec
@ 2019-11-05 18:27 ` Colin King
  0 siblings, 0 replies; 4+ messages in thread
From: Colin King @ 2019-11-05 18:27 UTC (permalink / raw)
  To: Saeed Mahameed, Leon Romanovsky, David S . Miller, Parav Pandit,
	netdev, linux-rdma
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Currently when a call to  esw_vport_create_legacy_ingress_acl_group
fails the error exit path to label 'out' will cause a kvfree on the
uninitialized pointer spec.  Fix this by ensuring pointer spec is
initialized to NULL to avoid this issue.

Addresses-Coverity: ("Uninitialized pointer read")
Fixes: 10652f39943e ("net/mlx5: Refactor ingress acl configuration")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/eswitch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
index 7baade9e62b7..f2e400a23a59 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
@@ -1253,7 +1253,7 @@ static int esw_vport_ingress_config(struct mlx5_eswitch *esw,
 	struct mlx5_flow_destination drop_ctr_dst = {0};
 	struct mlx5_flow_destination *dst = NULL;
 	struct mlx5_flow_act flow_act = {0};
-	struct mlx5_flow_spec *spec;
+	struct mlx5_flow_spec *spec = NULL;
 	int dest_num = 0;
 	int err = 0;
 	u8 *smac_v;
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH][next] net/mlx5: fix kvfree of uninitialized pointer spec
  2019-11-05 18:27 ` Colin King
@ 2019-11-06  6:24   ` Saeed Mahameed
  -1 siblings, 0 replies; 4+ messages in thread
From: Saeed Mahameed @ 2019-11-06  6:24 UTC (permalink / raw)
  To: Parav Pandit, linux-rdma, colin.king, davem, leon, netdev
  Cc: kernel-janitors, linux-kernel

On Tue, 2019-11-05 at 18:27 +0000, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Currently when a call to  esw_vport_create_legacy_ingress_acl_group
> fails the error exit path to label 'out' will cause a kvfree on the
> uninitialized pointer spec.  Fix this by ensuring pointer spec is
> initialized to NULL to avoid this issue.
> 
> Addresses-Coverity: ("Uninitialized pointer read")
> Fixes: 10652f39943e ("net/mlx5: Refactor ingress acl configuration")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  drivers/net/ethernet/mellanox/mlx5/core/eswitch.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
> b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
> index 7baade9e62b7..f2e400a23a59 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
> @@ -1253,7 +1253,7 @@ static int esw_vport_ingress_config(struct
> mlx5_eswitch *esw,
>  	struct mlx5_flow_destination drop_ctr_dst = {0};
>  	struct mlx5_flow_destination *dst = NULL;
>  	struct mlx5_flow_act flow_act = {0};
> -	struct mlx5_flow_spec *spec;
> +	struct mlx5_flow_spec *spec = NULL;
>  	int dest_num = 0;
>  	int err = 0;
>  	u8 *smac_v;


Applied to mlx5-next.
Thanks!

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH][next] net/mlx5: fix kvfree of uninitialized pointer spec
@ 2019-11-06  6:24   ` Saeed Mahameed
  0 siblings, 0 replies; 4+ messages in thread
From: Saeed Mahameed @ 2019-11-06  6:24 UTC (permalink / raw)
  To: Parav Pandit, linux-rdma, colin.king, davem, leon, netdev
  Cc: kernel-janitors, linux-kernel

T24gVHVlLCAyMDE5LTExLTA1IGF0IDE4OjI3ICswMDAwLCBDb2xpbiBLaW5nIHdyb3RlOg0KPiBG
cm9tOiBDb2xpbiBJYW4gS2luZyA8Y29saW4ua2luZ0BjYW5vbmljYWwuY29tPg0KPiANCj4gQ3Vy
cmVudGx5IHdoZW4gYSBjYWxsIHRvICBlc3dfdnBvcnRfY3JlYXRlX2xlZ2FjeV9pbmdyZXNzX2Fj
bF9ncm91cA0KPiBmYWl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
NyArMTI1Myw3IEBAIHN0YXRpYyBpbnQgZXN3X3Zwb3J0X2luZ3Jlc3NfY29uZmlnKHN0cnVjdA0K
PiBtbHg1X2Vzd2l0Y2ggKmVzdywNCj4gIAlzdHJ1Y3QgbWx4NV9mbG93X2Rlc3RpbmF0aW9uIGRy
b3BfY3RyX2RzdCA9IHswfTsNCj4gIAlzdHJ1Y3QgbWx4NV9mbG93X2Rlc3RpbmF0aW9uICpkc3Qg
PSBOVUxMOw0KPiAgCXN0cnVjdCBtbHg1X2Zsb3dfYWN0IGZsb3dfYWN0ID0gezB9Ow0KPiAtCXN0
cnVjdCBtbHg1X2Zsb3dfc3BlYyAqc3BlYzsNCj4gKwlzdHJ1Y3QgbWx4NV9mbG93X3NwZWMgKnNw
ZWMgPSBOVUxMOw0KPiAgCWludCBkZXN0X251bSA9IDA7DQo+ICAJaW50IGVyciA9IDA7DQo+ICAJ
dTggKnNtYWNfdjsNCg0KDQpBcHBsaWVkIHRvIG1seDUtbmV4dC4NClRoYW5rcyENCg=

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-11-06  6:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-05 18:27 [PATCH][next] net/mlx5: fix kvfree of uninitialized pointer spec Colin King
2019-11-05 18:27 ` Colin King
2019-11-06  6:24 ` Saeed Mahameed
2019-11-06  6:24   ` Saeed Mahameed

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.