From nobody Fri Nov 27 00:12:03 2026 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 4jbDPJ1RM5z71JRC for ; Fri, 27 Nov 2026 00:12:04 +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) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jbDPJ09qYz4Sl0 for ; Fri, 27 Nov 2026 00:12:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1795738324; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7QCglFQVm+l/mXNjRKwooZLmsYgBsMoXEK05EV247Gc=; b=wzRmV5ernV6UN80SjkElfvhmeUXXqmYPLKdbQqcphX9BP3YLEk/8r7HPwh5nzhn59Sf3tm Vot8mzWEFvCwQa+wBFuq7YlqOmnOeLF0wyatcBq1Dec02OIGdXn2LAIpOprUrI6h0kjCkX Dc+XZYBWPfxMBn/1L5Ts7qxer2s5aqQN8BgEn0feyNmz6GWncEVn+4RHqpUrzzDe66FuT4 /ZjsPo7RTxHyZyF1fUa6zL1/SGzJtmXWLkPKXbcNsfNYmR50k0cxpMZazobxvCqWD8SfyZ PgmCsOPVJ2KdL6CjJe3d3KsK4tbJBAw0xa9F2A9yDm9sgjOfXltDHWqd/DRWNA== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1795738324; b=CJWuFqngvuivc61hkDSZAltEf0wljjIF5wzF/XIyuzzbLI2sHzw47ajtDGdp5UvH0kE26W V9WBjvrpf/Ozs33vltxDgiwd5/BE3oL7Cl1nf2NF8ZXfJge3FC68IvWpLeuwtJz9UBH9Ft m2eXrEUMvleGyOO+TmFD1X/EDo5maEtOFShHjzii2NF2wSPB0MCEmc0LrjVvhiebGmWsTK 5psEf/7MXy8mGp9dRUXjxbBiOWoobGO1CW/yK4n+8Cd30DtrNs3Thbzw3R3R+Yf5SkHcrp 4ubUm8HT1YVEDy80iriyOZA4l1TkyBBiuxBeKvYnZBDOUVyR/4kQsU+ZcJ0pgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1795738324; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7QCglFQVm+l/mXNjRKwooZLmsYgBsMoXEK05EV247Gc=; b=KFHgkGtzmjwL9fB0A8YOE+iziOoGZkcurGk/MX66J65nLnPJ/UJNTChYt5JCOvu1kcau15 omW4MuHLYfLCXHgmXMNWOntWz2yFW3ZaXgnavRfFscTp39J+3OSrLHW/Zm5Moz9MGzU7da AdW0qEt3Hz2HxULu32FPvJPzEodF+LPW+d1q6Zm44EmVdzqHFMcBddF6lEgv+ZI6EsmV47 ZYxz8SbDaWaRDgCFU5xub/xU8IvgwCMAhZMbDnVenUAfO2rReArSWRl4SyprP0r6PmHkZY eCueb4t1KxyfEsFlKtwVtCfi1h2RvEqIkLULqWfjblMXY187ex0BoWcgQ5LF/g== 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 4jbDPH6xh1zc8t for ; Fri, 27 Nov 2026 00:12:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id ad29 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 27 Nov 2026 00:12:03 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Ed Maste From: Colin Percival Subject: git: 86f463044f95 - releng/15.2 - tzcode: Avoid integer truncation resulting in wrong weekday List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all X-BeenThere: dev-commits-src-all@freebsd.org List-Id: Commit messages for all branches of the src repository List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/releng/15.2 X-Git-Reftype: branch X-Git-Commit: 86f463044f951c456016d40dbb0aeb7095aa8a10 Auto-Submitted: auto-generated Date: Fri, 27 Nov 2026 00:12:03 +0000 Message-Id: <6b08cad3.ad29.7cce1c3f@gitrepo.freebsd.org> The branch releng/15.2 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=86f463044f951c456016d40dbb0aeb7095aa8a10 commit 86f463044f951c456016d40dbb0aeb7095aa8a10 Author: Ed Maste AuthorDate: 2026-11-25 21:39:41 +0000 Commit: Colin Percival CommitDate: 2026-11-27 00:11:51 +0000 tzcode: Avoid integer truncation resulting in wrong weekday From a report[1] on the tz mailing list: In timesub() the weekday is stored in (int) tm_wday before reduction modulo seven (DAYSPERWEEK). Previously this could overflow a 32-bit int, resulting in an incorrect weekday calculation. Calculate two additional intermediate terms modulo seven to avoid an intermediate value that does not fit in 32 bits. We're committing this patch now so we can have something in place for FreeBSD 15.2. If a different change is committed upstream we will replace this. [1] https://lists.iana.org/hyperkitty/list/tz@iana.org/thread/O3RZGBKSO5GXBFDZKW2JXO3OQIIGYBF3/ Approved by: re (cperciva) PR: 300977 Requested by: re (cperciva) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D62073 (cherry picked from commit ecb47941d089b9f9946afa6c52a33418491bfc66) (cherry picked from commit da83cb9c21e5fe5cca75fd5398b48b7522a88f0c) --- contrib/tzcode/localtime.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/tzcode/localtime.c b/contrib/tzcode/localtime.c index 397d7e8185c2..9bfbd332f81e 100644 --- a/contrib/tzcode/localtime.c +++ b/contrib/tzcode/localtime.c @@ -2419,8 +2419,8 @@ timesub(const time_t *timep, int_fast32_t offset, + ((y % DAYSPERWEEK - TM_YEAR_BASE % DAYSPERWEEK) % DAYSPERWEEK * (DAYSPERNYEAR % DAYSPERWEEK)) - + leaps_thru_end_of(y - 1) - - leaps_thru_end_of(TM_YEAR_BASE - 1) + + leaps_thru_end_of(y - 1) % DAYSPERWEEK + - leaps_thru_end_of(TM_YEAR_BASE - 1) % DAYSPERWEEK + idays); tmp->tm_wday %= DAYSPERWEEK; if (tmp->tm_wday < 0)