From nobody Tue Jan 6 13:34:21 2026 X-Original-To: dev-commits-src-branches@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 4dlsb728Sdz6NdmC for ; Tue, 06 Jan 2026 13:34:27 +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 "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dlsb66t4Yz3SmZ for ; Tue, 06 Jan 2026 13:34:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1767706467; 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=LYU1hfHgmjn+8ZYF/uueO09y9C1zaoyMfQZLjXW+p9c=; b=vn9Q2SAvkid8z5WScH1yMoIPdYBu8geJbI/6KicrNc7PjYVuDtjII9K+XlSedL/bqpU+CB TuCKLNvTI0z3bpJm+RI0US0UUhe0lnqJjBWo+QsJSRTQ1TFHR25GqeMZ8NqOl+RLRl6TGK WT7bdVR9C4gtZ2R7/WOeb1mpOxfJshzrFl5gOHSWEby3xaqEYJIYMphC8iir7WtxSsECKy uokM9pp3yC7UsIkW7ONi/qlgURq+mH/qQzU1dM3bzOGmshzke1HKMsJVBuCBcOrVDlS+R/ Nf9TQyGRDYT7MwToxLDEV/EKAOWLsAy+ctWNOOMe7O4M3yGLFySKXTx0KHsNvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1767706467; 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=LYU1hfHgmjn+8ZYF/uueO09y9C1zaoyMfQZLjXW+p9c=; b=WLezsFxUf6S4tqNkET6/zdnWrH4lqU2Tg2CjSP9UHblZQADW2dBozvX0B4c8fjjznm0KJi 0YzvYaqz95+m1wIYbPHIJdAJhEqMxU7Fo0SpzpCvpUF7/Np8Jfwf7Kt7kEbzArr3XflkqM 9JkehiO6BMuxiZLM+cu2ZnaY7u0K8cDJKOK1LUQKgEpjB8ticHreQYkw5se5F0gCR0tqfA wRR6luSEyLHE0Pmf7scvtbdXYzV3mBVLvNyluruOmhyKtoNsbtaUdVe7l3U9131yfpQKtK nGqX5atdAMsvUEVxxB0PgsKNsJMslbT1QIBOlvk3UshicUasbVU6JRd9XnQ4pg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1767706467; a=rsa-sha256; cv=none; b=Jj6XkF1WW9I7M1wstRRDZJuub+fa0g1ijBnrttQZds8z1pIJpoYwpcfkHF419I6qkOLSqP CqntMnjf8JUg2Be8u9Yx1LRnRhbzNmJ6QJU2c285Z3MlbaPkY9dtpDWOrK1Qk2cosNexZd yVpFU6iC5+h0g2LRdGNVJFknKen/MQHuPjXXzIINDSQweRzllhlsMU3gzyAr7bto4hh74D K3gROLr3srzes2MYCxZljtf9nWGxnvOgncPzlH/4HAUt/ck4HO4pjIgZ2KDI1t0Rzg2ooO wpAyDub4pt5tTSV7szlG7tIMapm2oHXW2KzePYsXwPOL1l+z/w8muhIVIQLpTw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dlsb16LzWz17XD for ; Tue, 06 Jan 2026 13:34:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3fc55 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 06 Jan 2026 13:34:21 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 12fbcfd4a6b9 - stable/15 - libsa: smbios: Detect less-than-64-bit platforms via __SIZEOF_SIZE_T__ List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 12fbcfd4a6b9bf9a01391432f80a2595fc1d4707 Auto-Submitted: auto-generated Date: Tue, 06 Jan 2026 13:34:21 +0000 Message-Id: <695d0f5d.3fc55.18f61acc@gitrepo.freebsd.org> The branch stable/15 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=12fbcfd4a6b9bf9a01391432f80a2595fc1d4707 commit 12fbcfd4a6b9bf9a01391432f80a2595fc1d4707 Author: Olivier Certner AuthorDate: 2025-03-11 16:56:20 +0000 Commit: Olivier Certner CommitDate: 2026-01-06 13:33:19 +0000 libsa: smbios: Detect less-than-64-bit platforms via __SIZEOF_SIZE_T__ What we really want here is to know if pointers can refer to 64-bit addresses, regardless of whether they also hold other information (such as capabilities in CHERI). __SIZEOF_SIZE_T__ is probably the closest indication to that piece of information, so let's use it. __ILP32__ wasn't wrong in practice though, as we don't support 32-bit CHERI hardware (and likely never will). Consistently with this change, test whether we can actually address the 64-bit SMBIOS's structure table by converting the end address to 'size_t' and checking whether its value is preserved. Suggested by: jhb (for the __ILP32__ => __SIZEOF_SIZE_T__ part) Reviewed by: jhb, imp MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D49318 (cherry picked from commit d3bfcd66409befc2d545e5449963b41c25c369a9) --- stand/libsa/smbios.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/stand/libsa/smbios.c b/stand/libsa/smbios.c index 32cd198a9537..73b49a111f89 100644 --- a/stand/libsa/smbios.c +++ b/stand/libsa/smbios.c @@ -186,14 +186,17 @@ smbios_sigsearch(const caddr_t addr, const uint32_t len) */ SMBIOS_GET8(cp, 0x0a) != 0 && smbios_checksum(cp, SMBIOS_GET8(cp, 0x06)) == 0) { -#ifdef __ILP32__ +#if __SIZEOF_SIZE_T__ < 8 uint64_t end_addr; end_addr = SMBIOS_GET64(cp, 0x10) + /* Start address. */ SMBIOS_GET32(cp, 0x0c); /* Maximum size. */ - /* Is the table (or part of it) located above 4G? */ - if (end_addr >= (uint64_t)1 << 32) - /* Can't access it with 32-bit addressing. */ + /* + * Is the table (or part of it) located above what we + * can address? + */ + if ((size_t)end_addr != end_addr) + /* Yes, give it up. */ continue; #endif smbios.is_64bit_ep = 1;