git: DragonFly_RELEASE_6_4 catopen(3): Fix race condition

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


commit f676c6bb83aa3bceb0cd4809d07eac90b3337cdd
Author: Aaron LI <aly at aaronly.me>
Date:   Mon Oct 5 20:44:06 2026 +0800

    catopen(3): Fix race condition
    
    The current code uses a rwlock to protect the cached list, which
    in turn holds a list of catentry objects, and increments reference
    count while holding only read lock.  Fix this by converting the
    reference counter to use atomic operations.
    
    Also improve the cleanups of memory allocations.
    
    Obtained-from: FreeBSD (commit 4188ba1a3b65b4a55fc938b71d9091fafb57967d)
    Reported-by: pmjdebruijn
    Bug: https://bugs.dragonflybsd.org/issues/3393

Summary of changes:
 lib/libc/nls/msgcat.c | 59 +++++++++++++++++++++++++++++++++------------------
 1 file changed, 38 insertions(+), 21 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/f676c6bb83aa3bceb0cd4809d07eac90b3337cdd


-- 
DragonFly BSD source repository


More information about the Commits mailing list