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)
Mon, Jul 29, 6:04 AM
Unknown Object (File)
Mon, Jul 29, 12:19 AM
Unknown Object (File)
Sun, Jul 28, 1:31 AM
Unknown Object (File)
Wed, Jul 24, 8:01 PM
Unknown Object (File)
Jun 22 2024, 1:22 PM
Unknown Object (File)
Jun 22 2024, 12:52 PM
Unknown Object (File)
Jun 22 2024, 12:46 PM
Unknown Object (File)
May 3 2024, 2:02 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