From nobody Wed Mar 29 05:04:21 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PmZGY5yK9z41ykg; Wed, 29 Mar 2023 05:04:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PmZGY5Jkmz4HPp; Wed, 29 Mar 2023 05:04:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1680066261; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NnwY0dj1nNOH9zw7dCaZRs75d9gAvtoy68xvPJeUHGQ=; b=BGx+WfyadkRz2CQusJHMpkFXD8qWQi5MTwlw8WMrIEmrLls2vCPzETmkHgge4a7rCSD0Ht ZLoQlcyCm1MO7a7U+mRwHKr+v/tSaU8eQejPMTNphAgZVMsXA/u27hnbMm9ArD3UKUGUVW 89HPkaHFmI7FfQTYJuOfTGvKRbZE33ioewE1PIwYG2CShCyIH8DM3OZ2//OqVOg1iPT1xN JbvxLubibc/kgGaB2wgYKUl0XzGDNFREVA5gxIn+YMzaD1bqNzDxBKSO176e8MPfMwoP+X G+dJzPHZkapHVo5SwcW74i5WLFYQ6+H57s+0fMUMQuWgUTGiSjRPmNBMmjTFmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1680066261; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NnwY0dj1nNOH9zw7dCaZRs75d9gAvtoy68xvPJeUHGQ=; b=SAufDDNjnesDbDnm/tLGLtch1ufU0t/Z91AfBVozQfFnYWkb/gc7CCxqlST0luX0dz/sQb PTB35/mxc11OoajsO+81iLC13QH6tClV0z8yEl9OGxYoT+Vsp+4rXazpFEkXf0mc9Ypo4q c7iGg769OgQNX74V20Wf0gb8PvJkz8zVGplad/HsaCQeNqb5UWB/mX1JdomKrvDmZmWHP9 T4XvCLV+E1ltF5S3BBfSOaVk/sRB/p1US5lQQ2YsCnY2yzqkd1eSWq5oq8+J27kwRRntIL nX6TSbREG/rEG14g4pcEG+65VSvHTCAN5+bXE9FIo/BD6YhZFUoqI8oHQ7aAZA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1680066261; a=rsa-sha256; cv=none; b=JXVuCajkxHOt4+T0+eIuMmvWhiQM70NJCesQtD5d+t64WAlOofxOIqrE5BNQag4TTVpF9h zyS9DGWbf7tqu9Sy3CCHYbluaifq3CCAoZ7Lid1Lt3Ts1NR4FlnzfTzmeO3+VnDiUBxAWk E75CA0xPHcv3TgPhvpI3g1D01fuiFodb47W3pL+3Ngwz613z3nOVw6bin0Vv7At/kNiJP9 ZtvIFNtFO2QAo3BZ/hUlqHCVI9+y/1lfktgBhTDhHl+G65Iy7GciHBiR6Hw040DaQUHXxO dsQbj1vAD2K7+43Ngl3As9hslkTUjo04toKj8CfEdzLymVTOvU3G9qbfsuZkDA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PmZGY4NDgzHQh; Wed, 29 Mar 2023 05:04:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32T54L7q074307; Wed, 29 Mar 2023 05:04:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32T54LtN074306; Wed, 29 Mar 2023 05:04:21 GMT (envelope-from git) Date: Wed, 29 Mar 2023 05:04:21 GMT Message-Id: <202303290504.32T54LtN074306@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 21d29c519221 - main - cred: make the refcount signed List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 21d29c51922141ff26a4d0e47efe6b551eb03e0e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=21d29c51922141ff26a4d0e47efe6b551eb03e0e commit 21d29c51922141ff26a4d0e47efe6b551eb03e0e Author: Mateusz Guzik AuthorDate: 2023-03-22 21:44:55 +0000 Commit: Mateusz Guzik CommitDate: 2023-03-29 05:02:04 +0000 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 --- sys/sys/ucred.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/ucred.h b/sys/sys/ucred.h index 6a9becb54c75..5ec54be70c2e 100644 --- a/sys/sys/ucred.h +++ b/sys/sys/ucred.h @@ -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