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)
Fri, Dec 6, 4:35 PM
Unknown Object (File)
Fri, Nov 22, 12:12 PM
Unknown Object (File)
Nov 17 2024, 10:41 AM
Unknown Object (File)
Nov 15 2024, 10:43 AM
Unknown Object (File)
Oct 29 2024, 2:31 AM
Unknown Object (File)
Oct 29 2024, 2:31 AM
Unknown Object (File)
Oct 29 2024, 2:30 AM
Unknown Object (File)
Oct 29 2024, 2:11 AM

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.