From nobody Thu Aug 01 20:43:19 2024 X-Original-To: dev-commits-src-all@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 4WZgsN0QbBz5RQq8; Thu, 01 Aug 2024 20:43:20 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZgsM5b2wz4MDt; Thu, 1 Aug 2024 20:43:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722544999; 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=sZnYWYe+xSsTlfJYU60bEpFoNchrztNzgUl+67zK/Ns=; b=o1Hf4m8IbQ5W3Smhms6Ij+DA20B93T0N6UbhmrHuFgyqY3BhdA9fqRhO8GCTo+i3q62/zf Q6lZagZYQYn9qDIo2638KeLB56HQ471Jra+6Z9y4LPEXL9AOfqokUNT9J7qtlMdHZLZ+LZ 6P6U1BMvZx3Po7fEVeLLiXNZ759Th/kwx24irefNAtqmN8mSGWwcKcK0JVOraIFepoST1i Wtc362UERQrFsjJrFHZnMQsiQVhri/pqpqBurz86d9qJLtol33ll4J2J/CFNX7HzBzo2mp oQU8AcpCdDhZYQOfO0duT4mDZ54IKDxZT7ly8bOMo8u+geARQB5DvWSxQBaOIw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722544999; a=rsa-sha256; cv=none; b=PthkhcDr3m6fj0I5yGKexnmHi/CpVf0juafPUoFR8KDjZw/XWif10BESRfLB5/2Av3jnFS g2nN8RZPnG3qHg4nnWnWfG0JBZ5zfmYpp8hvkdk9FV+3xdwg4CvmCJ0HY+y/6plS1PEDc/ F303DU9oHVKkVXfpxgE1wi6E1csUlh2q+CAogyJ81/necOyN5XuI/0WiXGpZzL755m46jh EvO3l7UDN3AqAuXvuc+t+EZRNO6jehrHkHSsaXoHAv5Z5iA5ty3LKXc6aPdamyK0W2O0zf aW9WR8L49OiO/Lo4K8TiXJ1JxBnMO3J6/IX+/DmtQ5vFOcDo5nviBDBaNIEP9g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722544999; 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=sZnYWYe+xSsTlfJYU60bEpFoNchrztNzgUl+67zK/Ns=; b=OG36PbGt7ukyR/R6IhlhmBWqIkZ28BisnPAMXKbc+q+0cjHdUXrrsgsHNLaEMNzgFvVm/+ BoHx6c9AqtOiGOYyq1zWoESQyg2NxuetHVHlMkNJeVesmjUvesPL/pm+qcH08YbPe1QjmI J+7MrNNpunK3XGSa9OJFB+eG41FhEdbSh88fvHtquTbZYx0c+6UD/Vy/0WDmEaKGt66ELj 4Mv7akwCM3I4ZPQxJIvGOyrHJuQp4Vu1cpQ3sanze+d5sHhkgoZ2qhBjYoDzSHnZIrKCzW k1Sg+idn1vj6Qlim9l7V+11HG9R8NrdDGZ11zlcbbUrtnQT5EyL+P5QtKk4HDA== 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 4WZgsM4hL5z10hy; Thu, 1 Aug 2024 20:43:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 471KhJHM054843; Thu, 1 Aug 2024 20:43:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471KhJSq054840; Thu, 1 Aug 2024 20:43:19 GMT (envelope-from git) Date: Thu, 1 Aug 2024 20:43:19 GMT Message-Id: <202408012043.471KhJSq054840@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: de866aa35240 - main - ssp: switch to _limits.h for the upper bound of size_t List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: de866aa35240856bf3b0d89f253b8dc2796b11f9 Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=de866aa35240856bf3b0d89f253b8dc2796b11f9 commit de866aa35240856bf3b0d89f253b8dc2796b11f9 Author: Kyle Evans AuthorDate: 2024-08-01 20:09:20 +0000 Commit: Kyle Evans CommitDate: 2024-08-01 20:42:17 +0000 ssp: switch to _limits.h for the upper bound of size_t The definitions in _stdint.h has some complications around visibility that _limits.h does not have. Switch to __SIZE_T_MAX to avoid those. This fixes the devel/gperf, devel/glib20 and math/mpfr builds with _FORTIFY_SOURCE enabled to unlock a large fraction of the ports tree to build. Reported by: Shawn Webb (HardenedBSD) Sponsored by: Klara, Inc. Sponsored by: Stormshield --- include/ssp/ssp.h | 6 +++--- include/ssp/wchar.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/ssp/ssp.h b/include/ssp/ssp.h index a161df31d3d4..6856c5ce6961 100644 --- a/include/ssp/ssp.h +++ b/include/ssp/ssp.h @@ -87,7 +87,7 @@ __ssp_redirect_raw_impl(rtype, fun, symbol, args) { \ #define __ssp_redirect0(rtype, fun, args, call) \ __ssp_redirect_raw(rtype, fun, fun, args, call, 1, __ssp_bos0, __len) -#include +#include __ssp_inline int __ssp_overlap(const void *leftp, const void *rightp, __size_t sz) @@ -96,9 +96,9 @@ __ssp_overlap(const void *leftp, const void *rightp, __size_t sz) __uintptr_t right = (__uintptr_t)rightp; if (left <= right) - return (SIZE_MAX - sz < left || right < left + sz); + return (__SIZE_T_MAX - sz < left || right < left + sz); - return (SIZE_MAX - sz < right || left < right + sz); + return (__SIZE_T_MAX - sz < right || left < right + sz); } #include diff --git a/include/ssp/wchar.h b/include/ssp/wchar.h index bbc84d379e56..7ed84e087f5d 100644 --- a/include/ssp/wchar.h +++ b/include/ssp/wchar.h @@ -35,7 +35,7 @@ __ssp_inline int __ssp_wchar_overlap(const void *leftp, const void *rightp, size_t len) { - if (len > SIZE_MAX / sizeof(wchar_t)) + if (len > __SIZE_T_MAX / sizeof(wchar_t)) return (1); return (__ssp_overlap(leftp, rightp, len * sizeof(wchar_t))); }