mirror of
https://github.com/torvalds/linux.git
synced 2026-06-07 22:14:04 +02:00
net/tls: don't ignore netdev notifications if no TLS features
[ Upstream commitc3f4a6c39c] On device surprise removal path (the notifier) we can't bail just because the features are disabled. They may have been enabled during the lifetime of the device. This bug leads to leaking netdev references and use-after-frees if there are active connections while device features are cleared. Fixes:e8f6979981("net/tls: Add generic NIC offload infrastructure") Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Reviewed-by: Dirk van der Merwe <dirk.vandermerwe@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
fb69403ec2
commit
fb6cf4f370
|
|
@ -974,7 +974,8 @@ static int tls_dev_event(struct notifier_block *this, unsigned long event,
|
|||
{
|
||||
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||
|
||||
if (!(dev->features & (NETIF_F_HW_TLS_RX | NETIF_F_HW_TLS_TX)))
|
||||
if (!dev->tlsdev_ops &&
|
||||
!(dev->features & (NETIF_F_HW_TLS_RX | NETIF_F_HW_TLS_TX)))
|
||||
return NOTIFY_DONE;
|
||||
|
||||
switch (event) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user