All of lore.kernel.org
 help / color / mirror / Atom feed
From: Saeed Mahameed <saeedm@mellanox.com>
To: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org, Roi Dayan <roid@mellanox.com>,
	Or Gerlitz <ogerlitz@mellanox.com>,
	Saeed Mahameed <saeedm@mellanox.com>
Subject: [net-next 08/15] net/mlx5: E-Switch, Protect from invalid memory access in offload fdb table
Date: Wed, 20 Mar 2019 16:39:52 -0700	[thread overview]
Message-ID: <20190320233959.31877-9-saeedm@mellanox.com> (raw)
In-Reply-To: <20190320233959.31877-1-saeedm@mellanox.com>

From: Roi Dayan <roid@mellanox.com>

The esw offloads structures share a union with the legacy mode structs.
Reset the offloads struct to zero in init to protect from null
assumptions made by the legacy mode code.

Signed-off-by: Roi Dayan <roid@mellanox.com>
Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
index 6c72f33f6d09..fe770cd2151c 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
@@ -1609,6 +1609,7 @@ static int esw_offloads_steering_init(struct mlx5_eswitch *esw, int nvports)
 {
 	int err;
 
+	memset(&esw->fdb_table.offloads, 0, sizeof(struct offloads_fdb));
 	mutex_init(&esw->fdb_table.offloads.fdb_prio_lock);
 
 	err = esw_create_offloads_fdb_tables(esw, nvports);
-- 
2.20.1


  parent reply	other threads:[~2019-03-20 23:40 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-20 23:39 [pull request][net-next 00/15] Mellanox, mlx5 updates 2019-03-20 Saeed Mahameed
2019-03-20 23:39 ` [net-next 01/15] net/mlx5: Simplify sriov enable/disable flow Saeed Mahameed
2019-03-20 23:39 ` [net-next 02/15] net/mlx5: Rename total_vfs to total_vports Saeed Mahameed
2019-03-20 23:39 ` [net-next 03/15] net/mlx5: Simplify mlx5_sriov_is_enabled() by using pci core API Saeed Mahameed
2019-03-20 23:39 ` [net-next 04/15] net/mlx5: Fix compilation warning in eq.c Saeed Mahameed
2019-03-20 23:39 ` [net-next 05/15] net/mlx5e: Fix port buffer function documentation format Saeed Mahameed
2019-03-20 23:39 ` [net-next 06/15] net/mlx5e: Fix compilation warning in en_tc.c Saeed Mahameed
2019-03-20 23:39 ` [net-next 07/15] net/mlx5e: Remove redundant assignment Saeed Mahameed
2019-03-20 23:39 ` Saeed Mahameed [this message]
2019-03-20 23:39 ` [net-next 09/15] net: Move the definition of the default Geneve udp port to public header file Saeed Mahameed
2019-03-20 23:54   ` Jakub Kicinski
2019-03-21 11:47     ` Moshe Shemesh
2019-03-20 23:39 ` [net-next 10/15] net/mlx5e: Take SW parser code to a separate function Saeed Mahameed
2019-03-20 23:39 ` [net-next 11/15] net/mlx5e: TX, Add geneve tunnel stateless offload support Saeed Mahameed
2019-03-20 23:39 ` [net-next 12/15] net: Add IANA_VXLAN_UDP_PORT definition to vxlan header file Saeed Mahameed
2019-03-20 23:55   ` Jakub Kicinski
2019-03-21 11:51     ` Moshe Shemesh
2019-03-20 23:39 ` [net-next 13/15] net/mlx5e: Add VLAN ID rewrite fields Saeed Mahameed
2019-03-20 23:39 ` [net-next 14/15] net/mlx5e: Support VLAN modify action Saeed Mahameed
2019-03-20 23:39 ` [net-next 15/15] net/mlx5e: Replace TC VLAN pop and push actions with VLAN modify Saeed Mahameed
2019-03-21 20:47 ` [pull request][net-next 00/15] Mellanox, mlx5 updates 2019-03-20 David Miller

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=20190320233959.31877-9-saeedm@mellanox.com \
    --to=saeedm@mellanox.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=ogerlitz@mellanox.com \
    --cc=roid@mellanox.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 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.