Bug 222512 - [netgraph] ng_con_nodes calls ng_findhook() on unprotected node2
Summary: [netgraph] ng_con_nodes calls ng_findhook() on unprotected node2
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: Eugene Grosbein
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-09-22 09:01 UTC by Andriy Gapon
Modified: 2017-11-06 12:53 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andriy Gapon freebsd_committer freebsd_triage 2017-09-22 09:01:44 UTC
ng_con_nodes() receives two nodes are parameters, 'node' is referenced and locked while 'node2' is just referenced.  Calling ng_findhook(node2) is racy with any hook modifications of node2.

The call should be removed as the check is also done, and with correct locking, in ng_con_part2().  It's just a little bit too noisy right now.