sage-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1777474164; 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=OrSl3ZH4jyjWn3nRhlUxkoYbRd7Tp2xWBDDr2JygHos=; b=RBykIKoe30BHCtodvsq43R5nMpohBZ7+rp6gJXNvJ4ZadRtwZlquWruU/vlBDpWUFkIqUC AL3/Mbr5acxlinXiq6cE6YTEOXAwy8sIt0c9F/oI2pqNM2zjUFo2eoRZyOY5NL8B66o9Fd 0YY8nKPIiZ1aYFUV0eAq6cb422D9xQj/foCxnh5fUM3fxj0DrPuZ8MBu2R3ZYRCZEYSx1e Pazc9a09/+tKbXwZFyZwnZYF+VidcBWDmq2lLSZixzes1sf3Osdk7o7c2Tq+DL3Ndp5+bf VNE0zou/SMLuePOr4n/KWkbIsYcBxVSa+mYXo3+nD0UbrKBfA4YifFczaT0XIg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4g5KvS1FDFzlWw for ; Wed, 29 Apr 2026 14:49:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3ba4b by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 29 Apr 2026 14:49:24 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 76734958a098 - releng/14.3 - dhclient: Fix reallocation of dhclient script environments 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: markj X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.3 X-Git-Reftype: branch X-Git-Commit: 76734958a0986bdd4cf7edfe845b5e7b4e152360 Auto-Submitted: auto-generated Date: Wed, 29 Apr 2026 14:49:24 +0000 Message-Id: <69f21a74.3ba4b.6dda83c1@gitrepo.freebsd.org> The branch releng/14.3 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=76734958a0986bdd4cf7edfe845b5e7b4e152360 commit 76734958a0986bdd4cf7edfe845b5e7b4e152360 Author: Mark Johnston AuthorDate: 2026-04-27 20:56:21 +0000 Commit: Mark Johnston CommitDate: 2026-04-28 20:33:04 +0000 dhclient: Fix reallocation of dhclient script environments When the number of DHCP options exceeds a threshold, script_set_env() will reallocate the environment, stored as an array of pointers. The calculation of the array size failed to multiply by the pointer size, resulting in a smaller than expected buffer which admits out-of-bounds writes. Approved by: so Security: FreeBSD-SA-26:15.dhclient Security: CVE-2026-42511 Reported by: Joshua Rogers of AISLE Research Team (https://aisle.com/) --- sbin/dhclient/dhclient.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c index 01ef38530cdf..c7a7fcca06ff 100644 --- a/sbin/dhclient/dhclient.c +++ b/sbin/dhclient/dhclient.c @@ -2438,8 +2438,8 @@ script_set_env(struct client_state *client, const char *prefix, char **newscriptEnv; int newscriptEnvsize = client->scriptEnvsize + 50; - newscriptEnv = realloc(client->scriptEnv, - newscriptEnvsize); + newscriptEnv = reallocarray(client->scriptEnv, + newscriptEnvsize, sizeof(char *)); if (newscriptEnv == NULL) { free(client->scriptEnv); client->scriptEnv = NULL;