HomeFreeBSD

Fix race condition in catopen(3).

Description

Fix race condition in catopen(3).

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.

While I'm there, also perform some clean ups around memory operations.

PR: 202636
Reported by: Henry Hu <henry.hu.sh@gmail.com>
Reviewed by: markj
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D24095

Details

Provenance
delphijAuthored on
Reviewer
markj
Differential Revision
D24095: Fix race condition in catopen(3).
Parents
rS359117: MFC r358070:
Branches
Unknown
Tags
Unknown