Page MenuHomeFreeBSD

netgraph: ng_device: set curvnet when writing from the cdev
AbandonedPublic

Authored by kevans on Sep 24 2025, 1:15 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 28, 8:30 PM
Unknown Object (File)
Fri, Nov 28, 8:30 PM
Unknown Object (File)
Mon, Nov 24, 10:23 PM
Unknown Object (File)
Oct 23 2025, 6:53 PM
Unknown Object (File)
Oct 18 2025, 8:13 PM
Unknown Object (File)
Oct 18 2025, 7:02 AM
Unknown Object (File)
Oct 10 2025, 9:19 AM
Unknown Object (File)
Oct 10 2025, 6:47 AM

Details

Summary

As noted in the comment, ng_snd_item() doesn't *always* need a vnet
context set -- in particular, it'll often enqueue the item instead of
sending it immediately, and the thread that later dequeues the item will
do the right thing. However, in the case of a node like ng_bridge, we
might be sending immediately and require curvnet to be set as it
transitions through the stack.

The cdev could be made visible for use by another vnet that is not the
ng_device's home, so be sure to use that one rather than the prison
vnet.

Reported by: Quentin Thébault <quentin.thebault@defenso.fr>
MFC after: 3 days

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 67270
Build 64153: arc lint + arc unit

Event Timeline

This revision is now accepted and ready to land.Sep 24 2025, 10:49 AM

Already landed in a505b80b2f038409300cd05e2ea95822942404e2, and it's clear nobody is using it in a way that this is urgent to MFC independently