Page MenuHomeFreeBSD

Destroying lagg interface causes a crash.
ClosedPublic

Authored by markb_mellanox.com on Oct 14 2015, 11:34 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, May 11, 6:59 AM
Unknown Object (File)
Sun, May 5, 10:28 PM
Unknown Object (File)
Wed, Apr 24, 7:25 PM
Unknown Object (File)
Feb 20 2024, 10:05 AM
Unknown Object (File)
Dec 25 2023, 4:23 AM
Unknown Object (File)
Dec 20 2023, 1:26 AM
Unknown Object (File)
Dec 11 2023, 12:39 AM
Unknown Object (File)
Dec 9 2023, 10:29 PM

Details

Summary

Creating a lagg port attaching i>0 interfaces and then destroying causes a crash

ifconfig lagg destroy

Steps to reproduce:

  1. ifconfig mce0 mce0
  2. ifconfig lagg0 create
  3. ifconfig lagg0 up laggproto lacp laggport mce0
  4. ifconfig lagg0 destroy

I believe this is caused by the following flow:

  1. lagg_clone_destroy is called
  2. we call: lagg_port_destroy(lp, 1); in a loop (going over all sc_ports)
  3. SLIST_REMOVE is called and we remove lp from sc_ports
  4. when the last interface is removed, inside lagg_port_destroy we enter the if : if (lp == sc->sc_primary) and because sc_ports is empty, lp0 == NULL
  1. We call: lagg_port_lladdr(lp0, lladdr); which means: lagg_port_lladdr(NULL, lladdr) and that causes a crash (we deference NULL inside lagg_port_lladdr).

This is a quick fix, I really don't know enough about the lagg module to say if this is the most correct solution.

Mark.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

markb_mellanox.com retitled this revision from to Destroying lagg interface causes a crash..
markb_mellanox.com updated this object.
markb_mellanox.com edited the test plan for this revision. (Show Details)
markb_mellanox.com set the repository for this revision to rS FreeBSD src repository - subversion.
hrs edited edge metadata.

This fix is correct. I will commit it asap.

This revision is now accepted and ready to land.Oct 16 2015, 1:14 AM
This revision was automatically updated to reflect the committed changes.