netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 5.15 1/9] usbnet: ipheth: race between ipheth_close and error handling
@ 2024-10-12 11:28 Sasha Levin
  2024-10-12 11:28 ` [PATCH AUTOSEL 5.15 2/9] usbnet: ipheth: fix carrier detection in modes 1 and 4 Sasha Levin
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Sasha Levin @ 2024-10-12 11:28 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Oliver Neukum, Foster Snowhill, Georgi Valkov, David S . Miller,
	Sasha Levin, edumazet, kuba, pabeni, linux-usb, netdev

From: Oliver Neukum <oneukum@suse.com>

[ Upstream commit e5876b088ba03a62124266fa20d00e65533c7269 ]

ipheth_sndbulk_callback() can submit carrier_work
as a part of its error handling. That means that
the driver must make sure that the work is cancelled
after it has made sure that no more URB can terminate
with an error condition.

Hence the order of actions in ipheth_close() needs
to be inverted.

Signed-off-by: Oliver Neukum <oneukum@suse.com>
Signed-off-by: Foster Snowhill <forst@pen.gy>
Tested-by: Georgi Valkov <gvalkov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/usb/ipheth.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/usb/ipheth.c b/drivers/net/usb/ipheth.c
index d56e276e4d805..4485388dcff2e 100644
--- a/drivers/net/usb/ipheth.c
+++ b/drivers/net/usb/ipheth.c
@@ -353,8 +353,8 @@ static int ipheth_close(struct net_device *net)
 {
 	struct ipheth_device *dev = netdev_priv(net);
 
-	cancel_delayed_work_sync(&dev->carrier_work);
 	netif_stop_queue(net);
+	cancel_delayed_work_sync(&dev->carrier_work);
 	return 0;
 }
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread
* [PATCH AUTOSEL 5.15 1/9] usbnet: ipheth: race between ipheth_close and error handling
@ 2024-08-23 14:04 Sasha Levin
  0 siblings, 0 replies; 5+ messages in thread
From: Sasha Levin @ 2024-08-23 14:04 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Oliver Neukum, Foster Snowhill, Georgi Valkov, David S . Miller,
	Sasha Levin, edumazet, kuba, pabeni, linux-usb, netdev

From: Oliver Neukum <oneukum@suse.com>

[ Upstream commit e5876b088ba03a62124266fa20d00e65533c7269 ]

ipheth_sndbulk_callback() can submit carrier_work
as a part of its error handling. That means that
the driver must make sure that the work is cancelled
after it has made sure that no more URB can terminate
with an error condition.

Hence the order of actions in ipheth_close() needs
to be inverted.

Signed-off-by: Oliver Neukum <oneukum@suse.com>
Signed-off-by: Foster Snowhill <forst@pen.gy>
Tested-by: Georgi Valkov <gvalkov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/usb/ipheth.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/usb/ipheth.c b/drivers/net/usb/ipheth.c
index d56e276e4d805..4485388dcff2e 100644
--- a/drivers/net/usb/ipheth.c
+++ b/drivers/net/usb/ipheth.c
@@ -353,8 +353,8 @@ static int ipheth_close(struct net_device *net)
 {
 	struct ipheth_device *dev = netdev_priv(net);
 
-	cancel_delayed_work_sync(&dev->carrier_work);
 	netif_stop_queue(net);
+	cancel_delayed_work_sync(&dev->carrier_work);
 	return 0;
 }
 
-- 
2.43.0


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

end of thread, other threads:[~2024-10-12 11:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-12 11:28 [PATCH AUTOSEL 5.15 1/9] usbnet: ipheth: race between ipheth_close and error handling Sasha Levin
2024-10-12 11:28 ` [PATCH AUTOSEL 5.15 2/9] usbnet: ipheth: fix carrier detection in modes 1 and 4 Sasha Levin
2024-10-12 11:28 ` [PATCH AUTOSEL 5.15 3/9] net: ethernet: use ip_hdrlen() instead of bit shift Sasha Levin
2024-10-12 11:28 ` [PATCH AUTOSEL 5.15 4/9] net: phy: vitesse: repair vsc73xx autonegotiation Sasha Levin
  -- strict thread matches above, loose matches on Subject: below --
2024-08-23 14:04 [PATCH AUTOSEL 5.15 1/9] usbnet: ipheth: race between ipheth_close and error handling Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).