From nobody Fri Sep 18 11:55:15 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 4hmWK04zvPz6sLvX for ; Fri, 18 Sep 2026 11:55:16 +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 "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hmWK02pJDz4KHk for ; Fri, 18 Sep 2026 11:55:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1789732516; 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=ZMB+hrTOWxI0gMTg9ez8UD6DwhDGlPkqD+rQ5a2bPRE=; b=IDGPUfLc3mEQIM2Ki1ifYwkrggZYkfHYLilhb1n+h0S87dwOCwKLwuM9OmmbAmNP4RZiW7 JMD8rp5b7rS0qC7yG1XOilJat8an6N9dS3y+am79/U84gnZYZ6LFT3UoO9yJM8bWH1paBS VPagSf3YXg5LKhHB1+EDrXVYYUy3XsHlK53aDClDVP2uXUVDosafQYm/l8I9OAihJC87Bf rLCrHnP3lZ3gQ4UFjGWGfd43mfjQVQ7h7E8SwdT4Zxuwi/Ku+D3vydTUC9YxG7OqawDZWa NUyW4Gj3NzFEmYAHl4GZ7cwgrbAqB1WTtyQZb4MzmOmZJz4dXyKJTqXNcT6CLQ== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1789732516; b=mESwoadtP/jN5hrxPQzDQ5TAZAvYs87Wnkr8wmqkcfeJQ1N1hdI3Oqd8DdDMkOanm7HYEF 7wzkCzYnvNB/f3Jt1BHCgTlFvPvDJKZBtiMZn8VH2Pvw9x05BWRA53lCp/rOzvUBbRHbBd ewRKHN9KTfDCq1C6e8TZ8LAUa/EXWhGtrnMOB7XjAOeG8LM2yq9RwerPFNzCG0dPqfyHV/ 9IvzmffZPdDMqjjsq9oIMw/VHdIKBWerbhY1HDjKX8aOrtYyLESfUfgycUIHLDDMd+/iDO J6aE9eexGSmgu7rTzW5nt8lAVEWmED4D15NXYcgmzOcsdE+xR6gRN3218giWiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1789732516; 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=ZMB+hrTOWxI0gMTg9ez8UD6DwhDGlPkqD+rQ5a2bPRE=; b=lL8mnVkbq53I4gfrT3bwANVppA3k4M/8aquaefLcoaV8cVaEKSWlvOkJ1BX5OWcHMXPiZw oQOZ+8SMs9ISUYZmwdVNqMGRckGxzW7kA406W/XLY8eWRO5P8pQ2xWAJ7EBwUcPg8y00tb 4ybiqRt9i2KLpFmlrF6wfhSsri2d3N63M9rLlIy9GeTeiMeGcTjoem9R8TN7rIVwNGX4xb aBeKh0xCIZxvXtrhElY+WZzXOOzV+Lu9DFUAsSJm1kVREVqDfbhHT7Xq+jU9umzkVK5j9m BPkWl4VArcoFVwvp+ThIouNia7kMv1oHXs7RZTy484+feqfLDHqCXpTqvfbOiw== 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 4hmWJz6VKqzHQx for ; Fri, 18 Sep 2026 11:55:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3306f by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 18 Sep 2026 11:55:15 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 73275ec3d6dc - stable/15 - rtld: more caution when parsing in digest_notes() 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 List-Id: 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: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 73275ec3d6dc4b110bef3b91b6f2a85f6f88f77e Auto-Submitted: auto-generated Date: Fri, 18 Sep 2026 11:55:15 +0000 Message-Id: <6aad26a3.3306f.103b6bae@gitrepo.freebsd.org> The branch stable/15 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=73275ec3d6dc4b110bef3b91b6f2a85f6f88f77e commit 73275ec3d6dc4b110bef3b91b6f2a85f6f88f77e Author: Konstantin Belousov AuthorDate: 2026-09-13 10:10:37 +0000 Commit: Konstantin Belousov CommitDate: 2026-09-18 11:54:59 +0000 rtld: more caution when parsing in digest_notes() (cherry picked from commit fa848d4d0c0371cdbf39265b6528f4c61bc02c7d) --- libexec/rtld-elf/rtld.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 93594201fc9e..63bf32c87e3c 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -1779,14 +1779,19 @@ digest_phdr(const Elf_Phdr *phdr, int phnum, caddr_t entry, const char *path) void digest_notes(Obj_Entry *obj, Elf_Addr note_start, Elf_Addr note_end) { - const Elf_Note *note; + const Elf_Note *note, *next_note; const char *note_name; uintptr_t p; - for (note = (const Elf_Note *)note_start; (Elf_Addr)note < note_end; - note = (const Elf_Note *)((const char *)(note + 1) + - roundup2(note->n_namesz, sizeof(Elf32_Addr)) + - roundup2(note->n_descsz, sizeof(Elf32_Addr)))) { + for (note = (const Elf_Note *)note_start;; note = next_note) { + if ((Elf_Addr)note + sizeof(Elf_Note) > note_end) + break; + next_note = (const Elf_Note *)((const char *)(note + 1) + + roundup2(note->n_namesz, sizeof(Elf32_Addr)) + + roundup2(note->n_descsz, sizeof(Elf32_Addr))); + if ((Elf_Addr)next_note > note_end) + break; + if (arch_digest_note(obj, note)) continue;