mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net] ice: Avoid tracing bridge ports after initialization failure
@ 2026-11-18  7:42 Alex Kazinsky
  2026-11-18  7:48 ` netdev-bot+sinfo
  0 siblings, 1 reply; 3+ messages in thread
From: Alex Kazinsky @ 2026-11-18  7:42 UTC (permalink / raw)
  To: Tony Nguyen
  Cc: Alex Kazinsky, Przemek Kitszel, Andrew Lunn, David S . Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Pawel Chmielewski,
	Wojciech Drewek, intel-wired-lan, netdev, linux-kernel,
	lvc-project, stable

ice_eswitch_br_port_link() traces representor and uplink bridge ports
before checking whether their initialization succeeded. If allocation
fails, the port pointer remains NULL. If xa_insert() fails, the cleanup
path clears the pointer and frees the port.

With the ice_eswitch_br_port_link trace event enabled, its handler
dereferences the NULL pointer while reading the port fields.

Call the tracepoint only after successful port initialization.

Found by Linux Verification Center (linuxtesting.org) with SVACE static
analysis tool.

Fixes: d129c2a245bf ("ice: add tracepoints for the switchdev bridge")
Cc: stable@vger.kernel.org
Signed-off-by: Alex Kazinsky <a.kazinsky@ideco.ru>
---
 drivers/net/ethernet/intel/ice/ice_eswitch_br.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_eswitch_br.c b/drivers/net/ethernet/intel/ice/ice_eswitch_br.c
index 1d8a6b95ccda..6d07c15ba9d8 100644
--- a/drivers/net/ethernet/intel/ice/ice_eswitch_br.c
+++ b/drivers/net/ethernet/intel/ice/ice_eswitch_br.c
@@ -1118,7 +1118,8 @@ ice_eswitch_br_port_link(struct ice_esw_br_offloads *br_offloads,
 		struct ice_repr *repr = ice_netdev_to_repr(dev);
 
 		err = ice_eswitch_br_vf_repr_port_init(bridge, repr);
-		trace_ice_eswitch_br_port_link(repr->br_port);
+		if (!err)
+			trace_ice_eswitch_br_port_link(repr->br_port);
 	} else {
 		struct net_device *ice_dev;
 		struct ice_pf *pf;
@@ -1134,7 +1135,8 @@ ice_eswitch_br_port_link(struct ice_esw_br_offloads *br_offloads,
 		pf = ice_netdev_to_pf(ice_dev);
 
 		err = ice_eswitch_br_uplink_port_init(bridge, pf);
-		trace_ice_eswitch_br_port_link(pf->br_port);
+		if (!err)
+			trace_ice_eswitch_br_port_link(pf->br_port);
 	}
 	if (err) {
 		NL_SET_ERR_MSG_MOD(extack, "Failed to init bridge port");
-- 
2.56.0



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

* Re: [PATCH net] ice: Avoid tracing bridge ports after initialization failure
  2026-11-18  7:42 [PATCH net] ice: Avoid tracing bridge ports after initialization failure Alex Kazinsky
@ 2026-11-18  7:48 ` netdev-bot+sinfo
  2026-11-18  8:00   ` Алексей Казинский
  0 siblings, 1 reply; 3+ messages in thread
From: netdev-bot+sinfo @ 2026-11-18  7:48 UTC (permalink / raw)
  To: Alex Kazinsky
  Cc: Tony Nguyen, Przemek Kitszel, Andrew Lunn, David S . Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Pawel Chmielewski,
	Wojciech Drewek, intel-wired-lan, netdev, linux-kernel,
	lvc-project, stable

Hi!

This is an automated message. This series looks like a fix, but its
commit messages seem to be missing some information:

 - What hardware the change was tested on. For driver fixes please
   mention the device (and if relevant firmware version) used for
   testing, or say that the change was not tested on real hardware.

Please do not repost the series just to address the above. Instead,
reply to this email with the missing information, so that reviewers
can take it into account.

*IMPORTANT*: If you do repost (for other reasons) - please include
the relevant info in the cover letter or commit messages.
-- 
The evaluation is done by an LLM so it may be wrong, if you think
that is the case please reply and explain.

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

* Re: [PATCH net] ice: Avoid tracing bridge ports after initialization failure
  2026-11-18  7:48 ` netdev-bot+sinfo
@ 2026-11-18  8:00   ` Алексей Казинский
  0 siblings, 0 replies; 3+ messages in thread
From: Алексей Казинский @ 2026-11-18  8:00 UTC (permalink / raw)
  To: netdev-bot+sinfo
  Cc: Tony Nguyen, Przemek Kitszel, Andrew Lunn, David S . Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Pawel Chmielewski,
	Wojciech Drewek, intel-wired-lan, netdev, linux-kernel,
	lvc-project, stable

18.11.2026 11:48, netdev-bot+sinfo@kernel.org wrote:
> Hi!
> 
> This is an automated message. This series looks like a fix, but its
> commit messages seem to be missing some information:
> 
>   - What hardware the change was tested on. For driver fixes please
>     mention the device (and if relevant firmware version) used for
>     testing, or say that the change was not tested on real hardware.
> 
> Please do not repost the series just to address the above. Instead,
> reply to this email with the missing information, so that reviewers
> can take it into account.
> 
> *IMPORTANT*: If you do repost (for other reasons) - please include
> the relevant info in the cover letter or commit messages.

Hi!
This change was not tested on real hardware.



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

end of thread, other threads:[~2026-11-18  8:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-18  7:42 [PATCH net] ice: Avoid tracing bridge ports after initialization failure Alex Kazinsky
2026-11-18  7:48 ` netdev-bot+sinfo
2026-11-18  8:00   ` Алексей Казинский

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®