Skip to content

net: fix bonding ipsec offload problems

Taehee Yoo intel-wired-lan netdev 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest9 patches 1 replyIn review
  2. v18 patches 4 repliesSuperseded

Changes in v2 from the cover letter

- Add 9th patch.
- Do not print warning when there is no SA in bond_ipsec_add_sa_all().
- Add comment for ipsec_lock.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9bonding: fix suspicious RCU usage in bond_ipsec_add_sa()drivers/net/bonding/bond_main.c+6 -10 replies
2/9bonding: fix null dereference in bond_ipsec_add_sa()drivers/net/bonding/bond_main.c+5 -00 replies
3/9net: netdevsim: use xso.real_dev instead of xso.dev in callback functions of struct xfrmdev_opsdrivers/net/netdevsim/ipsec.c+4 -40 replies
4/9ixgbevf: use xso.real_dev instead of xso.dev in callback functions of struct xfrmdev_opsdrivers/net/ethernet/intel/ixgbevf/ipsec.c+13 -70 replies
5/9bonding: fix suspicious RCU usage in bond_ipsec_del_sa()drivers/net/bonding/bond_main.c+5 -20 replies
6/9bonding: disallow setting nested bonding + ipsec offloaddrivers/net/bonding/bond_main.c+9 -60 replies
7/9bonding: Add struct bond_ipesc to manage SAdrivers/net/bonding/bond_main.c include/net/bonding.h+127 -210 replies
8/9bonding: fix suspicious RCU usage in bond_ipsec_offload_ok()drivers/net/bonding/bond_main.c+16 -60 replies
9/9bonding: fix incorrect return value of bond_ipsec_offload_ok()drivers/net/bonding/bond_main.c+1 -10 replies

Reviews trailers per patch

None of the 9 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchJay Vosburgh
SeriesA-b
1/9
2/9
3/9
4/9
5/9
6/9
7/9
8/9
9/9

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH net v2 0/9] net: fix bonding ipsec offload problems

This series fixes some problems related to bonding ipsec offload.

The 1, 5, and 8th patches are to add a missing rcu_read_lock(). The 2nd patch is to add null check code to bond_ipsec_add_sa. When bonding interface doesn't have an active real interface, the bond->curr_active_slave pointer is null.
But bond_ipsec_add_sa() uses that pointer without null check. So that it results in null-ptr-deref.
The 3 and 4th patches are to replace xs->xso.dev with xs->xso.real_dev. The 6th patch is to disallow to set ipsec offload if a real interface type is bonding.
The 7th patch is to add struct bond_ipsec to manage SA.
If bond mode is changed, or active real interface is changed, SA should be removed from old current active real interface then it should be added to new active real interface.
But it can't, because it doesn't manage SA.
The 9th patch is to fix incorrect return value of bond_ipsec_offload_ok().

v1 -> v2:
- Add 9th patch.
- Do not print warning when there is no SA in bond_ipsec_add_sa_all().
- Add comment for ipsec_lock.

Taehee Yoo (9):
bonding: fix suspicious RCU usage in bond_ipsec_add_sa()
bonding: fix null dereference in bond_ipsec_add_sa()
net: netdevsim: use xso.real_dev instead of xso.dev in callback
functions of struct xfrmdev_ops
ixgbevf: use xso.real_dev instead of xso.dev in callback functions of
struct xfrmdev_ops
bonding: fix suspicious RCU usage in bond_ipsec_del_sa()
bonding: disallow setting nested bonding + ipsec offload
bonding: Add struct bond_ipesc to manage SA
bonding: fix suspicious RCU usage in bond_ipsec_offload_ok()
bonding: fix incorrect return value of bond_ipsec_offload_ok()

 drivers/net/bonding/bond_main.c            | 181 +++++++++++++++++----
 drivers/net/ethernet/intel/ixgbevf/ipsec.c |  20 ++-
 drivers/net/netdevsim/ipsec.c              |   8 +-
 include/net/bonding.h                      |   9 +-
 4 files changed, 178 insertions(+), 40 deletions(-)
Signature · 1 line
2.17.1