linux-stable/drivers/net/bonding
Taehee Yoo 9a5605505d bonding: Add struct bond_ipesc to manage SA
bonding has been supporting ipsec offload.
When SA is added, bonding just passes SA to its own active real interface.
But it doesn't manage SA.
So, when events(add/del real interface, active real interface change, etc)
occur, bonding can't handle that well because It doesn't manage SA.
So some problems(panic, UAF, refcnt leak)occur.

In order to make it stable, it should manage SA.
That's the reason why struct bond_ipsec is added.
When a new SA is added to bonding interface, it is stored in the
bond_ipsec list. And the SA is passed to a current active real interface.
If events occur, it uses bond_ipsec data to handle these events.
bond->ipsec_list is protected by bond->ipsec_lock.

If a current active real interface is changed, the following logic works.
1. delete all SAs from old active real interface
2. Add all SAs to the new active real interface.
3. If a new active real interface doesn't support ipsec offload or SA's
option, it sets real_dev to NULL.

Fixes: 18cb261afd ("bonding: support hardware encryption offload to slaves")
Signed-off-by: Taehee Yoo <ap420073@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2021-07-06 10:36:59 -07:00
..
bond_3ad.c bonding: 3ad: Print an error for unknown speeds 2021-02-11 14:28:21 -08:00
bond_alb.c net: bonding: bond_alb: Fix some typos in bond_alb.c 2021-05-21 13:30:41 -07:00
bond_debugfs.c net: bonding: remove unnecessary braces 2021-05-20 15:43:24 -07:00
bond_main.c bonding: Add struct bond_ipesc to manage SA 2021-07-06 10:36:59 -07:00
bond_netlink.c net: bonding: use tabs instead of space for code indent 2021-05-20 15:43:24 -07:00
bond_options.c bonding: remove redundant initialization of variable ret 2021-06-03 15:25:29 -07:00
bond_procfs.c net: bonding: add some required blank lines 2021-05-20 15:43:24 -07:00
bond_sysfs.c net: bonding: add some required blank lines 2021-05-20 15:43:24 -07:00
bond_sysfs_slave.c bonding: wait for sysfs kobject destruction before freeing struct slave 2020-11-21 13:07:00 -08:00
bonding_priv.h drivers: Remove inclusion of vermagic header 2020-04-21 13:27:37 -07:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00