* [PATCH net v2 0/1] xfrm: Fix NETDEV_DOWN with IPSec offload
@ 2017-05-08  7:39 ilant
  2017-05-08  7:39 ` [PATCH net v2 1/1] " ilant
  0 siblings, 1 reply; 3+ messages in thread
From: ilant @ 2017-05-08  7:39 UTC (permalink / raw)
  To: David Miller, Steffen Klassert; +Cc: Boris Pismenny, netdev, Ilan Tayari
From: Ilan Tayari <ilant@mellanox.com>
v1 -> v2: Added Fixes tag
Ilan Tayari (1):
  xfrm: Fix NETDEV_DOWN with IPSec offload
 net/xfrm/xfrm_device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
-- 
2.11.0
^ permalink raw reply	[flat|nested] 3+ messages in thread
* [PATCH net v2 1/1] xfrm: Fix NETDEV_DOWN with IPSec offload
  2017-05-08  7:39 [PATCH net v2 0/1] xfrm: Fix NETDEV_DOWN with IPSec offload ilant
@ 2017-05-08  7:39 ` ilant
  2017-05-08 11:50   ` Steffen Klassert
  0 siblings, 1 reply; 3+ messages in thread
From: ilant @ 2017-05-08  7:39 UTC (permalink / raw)
  To: David Miller, Steffen Klassert; +Cc: Boris Pismenny, netdev, Ilan Tayari
From: Ilan Tayari <ilant@mellanox.com>
Upon NETDEV_DOWN event, all xfrm_state objects which are bound to
the device are flushed.
The condition for this is wrong, though, testing dev->hw_features
instead of dev->features. If a device has non-user-modifiable
NETIF_F_HW_ESP, then its xfrm_state objects are not flushed,
causing a crash later on after the device is deleted.
Check dev->features instead of dev->hw_features.
Fixes: d77e38e612a0 ("xfrm: Add an IPsec hardware offloading API")
Signed-off-by: Ilan Tayari <ilant@mellanox.com>
Acked-by: Steffen Klassert <steffen.klassert@secunet.com>
---
 net/xfrm/xfrm_device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/xfrm/xfrm_device.c b/net/xfrm/xfrm_device.c
index 8ec8a3fcf8d4..574e6f32f94f 100644
--- a/net/xfrm/xfrm_device.c
+++ b/net/xfrm/xfrm_device.c
@@ -170,7 +170,7 @@ static int xfrm_dev_feat_change(struct net_device *dev)
 
 static int xfrm_dev_down(struct net_device *dev)
 {
-	if (dev->hw_features & NETIF_F_HW_ESP)
+	if (dev->features & NETIF_F_HW_ESP)
 		xfrm_dev_state_flush(dev_net(dev), dev, true);
 
 	xfrm_garbage_collect(dev_net(dev));
-- 
2.11.0
^ permalink raw reply related	[flat|nested] 3+ messages in thread
* Re: [PATCH net v2 1/1] xfrm: Fix NETDEV_DOWN with IPSec offload
  2017-05-08  7:39 ` [PATCH net v2 1/1] " ilant
@ 2017-05-08 11:50   ` Steffen Klassert
  0 siblings, 0 replies; 3+ messages in thread
From: Steffen Klassert @ 2017-05-08 11:50 UTC (permalink / raw)
  To: ilant; +Cc: David Miller, Boris Pismenny, netdev
On Mon, May 08, 2017 at 10:39:34AM +0300, ilant@mellanox.com wrote:
> From: Ilan Tayari <ilant@mellanox.com>
> 
> Upon NETDEV_DOWN event, all xfrm_state objects which are bound to
> the device are flushed.
> 
> The condition for this is wrong, though, testing dev->hw_features
> instead of dev->features. If a device has non-user-modifiable
> NETIF_F_HW_ESP, then its xfrm_state objects are not flushed,
> causing a crash later on after the device is deleted.
> 
> Check dev->features instead of dev->hw_features.
> 
> Fixes: d77e38e612a0 ("xfrm: Add an IPsec hardware offloading API")
> Signed-off-by: Ilan Tayari <ilant@mellanox.com>
Applied, thanks Ilan!
^ permalink raw reply	[flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-05-08 11:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-08  7:39 [PATCH net v2 0/1] xfrm: Fix NETDEV_DOWN with IPSec offload ilant
2017-05-08  7:39 ` [PATCH net v2 1/1] " ilant
2017-05-08 11:50   ` Steffen Klassert
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).