cred: make the refcount signed

There are asserts on the count being > 0, but they are less useful than
they can be because the type itself is unsigned.

The kernel is compiled with -frapv, making wraparound perfectly defined.

Differential Revision:	https://reviews.freebsd.org/D39220
This commit is contained in:
Mateusz Guzik
2023-03-22 21:44:55 +00:00
parent 9fbeeb6e38
commit 21d29c5192
+1 -1
View File
@@ -61,7 +61,7 @@ struct loginclass;
#if defined(_KERNEL) || defined(_WANT_UCRED)
struct ucred {
struct mtx cr_mtx;
u_int cr_ref; /* (c) reference count */
int cr_ref; /* (c) reference count */
u_int cr_users; /* (c) proc + thread using this cred */
struct auditinfo_addr cr_audit; /* Audit properties. */
#define cr_startcopy cr_uid