Page MenuHomeFreeBSD

Resolve deadlock between epoch(9) and various network interface SX-locks
ClosedPublic

Authored by hselasky on Oct 22 2018, 11:36 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Jun 17, 3:10 PM
Unknown Object (File)
Tue, Jun 16, 2:54 AM
Unknown Object (File)
Thu, Jun 11, 1:21 AM
Unknown Object (File)
Wed, Jun 10, 11:38 PM
Unknown Object (File)
Tue, Jun 9, 5:05 PM
Unknown Object (File)
May 18 2026, 1:57 AM
Unknown Object (File)
May 18 2026, 1:57 AM
Unknown Object (File)
May 18 2026, 1:51 AM
Subscribers

Details

Summary

Resolve deadlock between epoch(9) and various network interface SX-locks, by not allowing to hold the epoch read lock over typical network interface driver IOCTL code paths. The remaining race for double free will be solved separately.

Not allowed behaviour for the network subsystem global epoch:
epoch_enter()
sx_xlock();
sx_xunlock();
epoch_exit();

Allowed behaviour for the network subsystems global epoch:
sx_xlock();
epoch_wait();
sx_xunlock();

MFC after: 1 week
Sponsored by: Mellanox Technologies

Test Plan
#!/usr/local/bin/bash
# Script to reproduce hang

for i in {1..255}
do
(ifconfig mce0.$i create; 
ifconfig mce0.$i inet 224.0.0.$i;
ifconfig mce0.$i destroy) &
done

Diff Detail

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