Page MenuHomeFreeBSD

bnxt: While VLAN TCP Tx is progress, "ifconfig destroy" caused kernel Crash in Iflib code
AcceptedPublic

Authored by bhargava.marreddy_broadcom.com on Nov 6 2017, 1:49 PM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 10 2024, 1:19 AM
Unknown Object (File)
Dec 24 2023, 10:01 AM
Unknown Object (File)
Dec 23 2023, 7:19 AM
Unknown Object (File)
Dec 22 2023, 11:29 PM
Unknown Object (File)
Dec 12 2023, 4:53 PM
Unknown Object (File)
Oct 19 2023, 2:37 AM
Unknown Object (File)
Oct 17 2023, 1:28 PM
Unknown Object (File)
Oct 15 2023, 6:33 AM

Details

Summary

This patch is for https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=222680

Repro Steps;-

  1. Boot into FreeBSD rev src_head_322823
  2. Create VLAN interface -
    1. ifconfig bnxt0.5 create vlan 5 vlandev bnxt0 inet 5.0.0.1/24
  3. Start Tx TCP using Stratus 100G A1 NIC
  4. While Throughput is ~ 90 Gbps, destroy VLAN interface ##ifconfig bnxt0.5 destroy
  5. Server Crashed
Test Plan

With the attached fix, tried VLAN destroy several times and no crash seen.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

This revision is now accepted and ready to land.Nov 9 2017, 8:12 PM

First off, please submit future patches with arc diff directly, or with a diff generated with full context.

Second, this only fixes the problem by chance. The fundamental problem here is that the ifnet we are checking has been freed, so accessing ANY memory on it is going to possibly crash the kernel. The only way to really solve this is to either fix the ifnet lifetime issues (not easy), or potentially do some sort of workaround where the BPF_MTAP for a VLAN interface happens within if_vlan itself (the only place where we can be sure the vlan ifnet still exists).

Matt Joras,

Thanks for the review.

The only way to really solve this is to either fix the ifnet lifetime issues (not easy)

<Chenna>
Can we push current patch for now (as quick fix) so that we can get some time to come up with proper fix.

Matt Joras, Sean Bruno, Stephen Hurd,

Can we push this patch for now (as quick fix) so that we can get some time to come up with proper fix.