git: DragonFly_RELEASE_6_4 kdmsg: protect connection-state publication and ownership

Aaron LI aly at crater.dragonflybsd.org
Thu Nov 12 23:21:39 PST 2026


commit 0f763dfb8c11fc3c780163648c9825899174f736
Author: David Bidner <david at crap.solutions>
Date:   Tue Oct 20 05:42:45 2026 +0200

    kdmsg: protect connection-state publication and ownership
    
    Autoinitiate can create a connection transaction after the writer has
    stopped. The state can survive into the next connection, where replacing
    conn_state loses its held reference. An old close callback can also drop
    the replacement state's reference instead of its own.
    
    Hold msglk across creation, publication and queuing, and do not initiate
    a connection once EXITNOACC is set. Use a locked allocator helper for
    this call path so the allocator does not need recursive lock acquisition.
    
    Release the previous conn_state reference before replacing it. On DELETE,
    clear and release the slot only when it still points to the callback's
    state, independently of whether a closing reply is needed.
    
    Dropping the previous conn_state reference is now only needed when two
    autoinitiates race on a live connection; otherwise the old transaction is
    cleaned up through the state tree.
    
    Bug: https://bugs.dragonflybsd.org/issues/3435

Summary of changes:
 sys/kern/kern_dmsg.c | 64 +++++++++++++++++++++++++++++++++++++++-------------
 1 file changed, 48 insertions(+), 16 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/0f763dfb8c11fc3c780163648c9825899174f736


-- 
DragonFly BSD source repository


More information about the Commits mailing list