]> git.baikalelectronics.ru Git - kernel.git/commit
xfrm: Fix NETDEV_DOWN with IPSec offload
authorIlan Tayari <ilant@mellanox.com>
Mon, 8 May 2017 07:30:18 +0000 (10:30 +0300)
committerSteffen Klassert <steffen.klassert@secunet.com>
Mon, 8 May 2017 07:41:09 +0000 (09:41 +0200)
commita8125d01cc21b5b58dde348e91641900bd2eee5d
treea4cd705e30cf4e8757e0fa82007a2be50a3ea798
parent36bfcbcd6f358cd826c3713db2f1241649c8254c
xfrm: Fix NETDEV_DOWN with IPSec offload

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: 2ed61e84269f ("xfrm: Add an IPsec hardware offloading API")
Signed-off-by: Ilan Tayari <ilant@mellanox.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
net/xfrm/xfrm_device.c