From: Wojciech Drewek <wojciech.drewek@intel.com>
To: intel-wired-lan@lists.osuosl.org
Cc: pmenzel@molgen.mpg.de, netdev@vger.kernel.org, vladbu@nvidia.com,
kuba@kernel.org, simon.horman@corigine.com,
dan.carpenter@linaro.org
Subject: [Intel-wired-lan] [PATCH iwl-next v6 03/12] ice: Don't tx before switchdev is fully configured
Date: Wed, 12 Jul 2023 13:03:28 +0200 [thread overview]
Message-ID: <20230712110337.8030-4-wojciech.drewek@intel.com> (raw)
In-Reply-To: <20230712110337.8030-1-wojciech.drewek@intel.com>
There is possibility that ice_eswitch_port_start_xmit might be
called while some resources are still not allocated which might
cause NULL pointer dereference. Fix this by checking if switchdev
configuration was finished.
Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: Wojciech Drewek <wojciech.drewek@intel.com>
---
drivers/net/ethernet/intel/ice/ice_eswitch.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/ethernet/intel/ice/ice_eswitch.c b/drivers/net/ethernet/intel/ice/ice_eswitch.c
index be5b22691f7c..15a4c148c28b 100644
--- a/drivers/net/ethernet/intel/ice/ice_eswitch.c
+++ b/drivers/net/ethernet/intel/ice/ice_eswitch.c
@@ -331,6 +331,9 @@ ice_eswitch_port_start_xmit(struct sk_buff *skb, struct net_device *netdev)
np = netdev_priv(netdev);
vsi = np->vsi;
+ if (!vsi || !ice_is_switchdev_running(vsi->back))
+ return NETDEV_TX_BUSY;
+
if (ice_is_reset_in_progress(vsi->back->state) ||
test_bit(ICE_VF_DIS, vsi->back->state))
return NETDEV_TX_BUSY;
--
2.40.1
_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
next prev parent reply other threads:[~2023-07-12 11:05 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-12 11:03 [Intel-wired-lan] [PATCH iwl-next v6 00/12] ice: switchdev bridge offload Wojciech Drewek
2023-07-12 11:03 ` [Intel-wired-lan] [PATCH iwl-next v6 01/12] ice: Skip adv rules removal upon switchdev release Wojciech Drewek
2023-07-22 6:43 ` Buvaneswaran, Sujai
2023-07-12 11:03 ` [Intel-wired-lan] [PATCH iwl-next v6 02/12] ice: Prohibit rx mode change in switchdev mode Wojciech Drewek
2023-07-22 6:44 ` Buvaneswaran, Sujai
2023-07-12 11:03 ` Wojciech Drewek [this message]
2023-07-22 6:44 ` [Intel-wired-lan] [PATCH iwl-next v6 03/12] ice: Don't tx before switchdev is fully configured Buvaneswaran, Sujai
2023-07-12 11:03 ` [Intel-wired-lan] [PATCH iwl-next v6 04/12] ice: Disable vlan pruning for uplink VSI Wojciech Drewek
2023-07-22 6:45 ` Buvaneswaran, Sujai
2023-07-12 11:03 ` [Intel-wired-lan] [PATCH iwl-next v6 05/12] ice: Unset src prune on " Wojciech Drewek
2023-07-22 6:46 ` Buvaneswaran, Sujai
2023-07-12 11:03 ` [Intel-wired-lan] [PATCH iwl-next v6 06/12] ice: Implement basic eswitch bridge setup Wojciech Drewek
2023-07-22 6:47 ` Buvaneswaran, Sujai
2023-07-12 11:03 ` [Intel-wired-lan] [PATCH iwl-next v6 07/12] ice: Switchdev FDB events support Wojciech Drewek
2023-07-22 6:48 ` Buvaneswaran, Sujai
2023-07-12 11:03 ` [Intel-wired-lan] [PATCH iwl-next v6 08/12] ice: Add guard rule when creating FDB in switchdev Wojciech Drewek
2023-07-22 6:48 ` Buvaneswaran, Sujai
2023-07-12 11:03 ` [Intel-wired-lan] [PATCH iwl-next v6 09/12] ice: Add VLAN FDB support in switchdev mode Wojciech Drewek
2023-07-22 6:49 ` Buvaneswaran, Sujai
2023-07-12 11:03 ` [Intel-wired-lan] [PATCH iwl-next v6 10/12] ice: implement bridge port vlan Wojciech Drewek
2023-07-22 6:50 ` Buvaneswaran, Sujai
2023-07-12 11:03 ` [Intel-wired-lan] [PATCH iwl-next v6 11/12] ice: implement static version of ageing Wojciech Drewek
2023-07-22 6:51 ` Buvaneswaran, Sujai
2023-07-12 11:03 ` [Intel-wired-lan] [PATCH iwl-next v6 12/12] ice: add tracepoints for the switchdev bridge Wojciech Drewek
2023-07-22 6:52 ` Buvaneswaran, Sujai
2023-07-12 16:47 ` [Intel-wired-lan] [PATCH iwl-next v6 00/12] ice: switchdev bridge offload Vlad Buslov
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=20230712110337.8030-4-wojciech.drewek@intel.com \
--to=wojciech.drewek@intel.com \
--cc=dan.carpenter@linaro.org \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pmenzel@molgen.mpg.de \
--cc=simon.horman@corigine.com \
--cc=vladbu@nvidia.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