HomeFreeBSD

netgraph(4): Don't process NGQF_MESG items in NET_EPOCH context.

Description

netgraph(4): Don't process NGQF_MESG items in NET_EPOCH context.

Netgraph has two main types of message items:

  • NGQF_DATA items are used for data processing. This is a hot path that

should be called from a NET_EPOCH context.

  • NGQF_MESG items are used for node configuration. There are many places

in netgraph(4) where processing the NGQF_MESG item can call sections of code
that are forbidden in the NET_EPOCH context.

All item types can be queued and then processed using ngthread().
But ngthread() is unconditionally enter in the NET_EPOCH section for all types.
This causes panic/deadlocks when processing NGQF_MESG elements.

Reported by: mjg
Reviewed by: glebius, vmaffione (mentor)
Tested by: mjg, afedorov
Approved by: glebius, vmaffione (mentor)
Sponsored by: vstack.com
Differential Revision: https://reviews.freebsd.org/D36496

Details

Provenance
afedorovAuthored on Sep 13 2022, 2:15 PM
Reviewer
glebius
Differential Revision
D36496: netgraph(4): Don't process NGQF_MESG items in NET_EPOCH context.
Parents
rGbb1d472d79f7: tcp: make CUBIC the default congestion control mechanism.
Branches
Unknown
Tags
Unknown