All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net 0/2] bonding: fix NULL deref in bond_rr_gen_slave_id
@ 2022-09-19 23:08 Jonathan Toppins
  2022-09-19 23:08 ` [PATCH net 1/2] selftests: bonding: cause oops " Jonathan Toppins
  2022-09-19 23:08 ` [PATCH net 2/2] bonding: fix NULL deref " Jonathan Toppins
  0 siblings, 2 replies; 7+ messages in thread
From: Jonathan Toppins @ 2022-09-19 23:08 UTC (permalink / raw)
  To: netdev @ vger . kernel . org

Fix a NULL dereference of the struct bonding.rr_tx_counter member because
if a bond is initially created with an initial mode != zero (Round Robin)
the memory required for the counter is never created and when the mode is
changed there is never any attempt to verify the memory is allocated upon
switching modes.

The first patch provides a selftest to demonstrate the issue and the
second patch fixes the issue.

Jonathan Toppins (2):
  selftests: bonding: cause oops in bond_rr_gen_slave_id
  bonding: fix NULL deref in bond_rr_gen_slave_id

 drivers/net/bonding/bond_main.c               | 15 +++---
 .../selftests/drivers/net/bonding/Makefile    |  3 +-
 .../bonding/bond-arp-interval-causes-panic.sh | 48 +++++++++++++++++++
 3 files changed, 56 insertions(+), 10 deletions(-)
 create mode 100755 tools/testing/selftests/drivers/net/bonding/bond-arp-interval-causes-panic.sh

-- 
2.31.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-09-20 12:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-19 23:08 [PATCH net 0/2] bonding: fix NULL deref in bond_rr_gen_slave_id Jonathan Toppins
2022-09-19 23:08 ` [PATCH net 1/2] selftests: bonding: cause oops " Jonathan Toppins
2022-09-20  0:01   ` Jay Vosburgh
2022-09-20  0:21     ` Jonathan Toppins
2022-09-19 23:08 ` [PATCH net 2/2] bonding: fix NULL deref " Jonathan Toppins
2022-09-20 10:08   ` Jussi Maki
2022-09-20 12:59   ` Jay Vosburgh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.