Page MenuHomeFreeBSD

Enter epoch when addding IPv4 multicast forwarding cache entry
ClosedPublic

Authored by karels on Mar 21 2022, 3:07 PM.
Tags
None
Referenced Files
F170772676: D34624.id104068.diff
Sun, Sep 6, 1:29 PM
Unknown Object (File)
Sun, Sep 6, 3:03 AM
Unknown Object (File)
Sun, Sep 6, 1:15 AM
Unknown Object (File)
Fri, Sep 4, 7:47 PM
Unknown Object (File)
Fri, Sep 4, 1:54 AM
Unknown Object (File)
Thu, Sep 3, 8:01 PM
Unknown Object (File)
Wed, Sep 2, 6:43 PM
Unknown Object (File)
Tue, Sep 1, 11:12 PM

Details

Summary

The code path from the IPv4 multicast setsockopt could call ip_output()
without entering an epoch. Specifically, the MRT_ADD_MFC setbsocopt
would call add_mfc(), which in turn called ip_mdq() to send queued
packets. This resulted in an epoch assert failure in ip_output().
Enter an epoch in add_mfc(), and add some epoch asserts to check
for similar failures.

Test Plan

tested with mrouted and rwhod -m

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bz added a subscriber: bz.

Sounds reasonable to me and I like the extra asserts for documentation purposes; I always wonder if the entire ioctl paths should just acquire/release epoch but that's a totally different can of worms.

This revision is now accepted and ready to land.Mar 21 2022, 3:24 PM
cy added a subscriber: cy.