From nobody Mon Dec 8 02:26:13 2025 X-Original-To: riscv@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 4dPm7T4NCLz6Jkj1 for ; Mon, 08 Dec 2025 02:26:13 +0000 (UTC) (envelope-from bugzilla-noreply@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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dPm7T394Vz3XW9 for ; Mon, 08 Dec 2025 02:26:13 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765160773; 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: in-reply-to:in-reply-to:references:references; bh=ICyb8x5QN3CnqBLX8TzvP4SXOsRJJq+YsF3M6bZ5s9Y=; b=kR5C+0CU5pI/F1cp5LMASzBChv23IAl9cRvCxhvwWV3sIOKLdoSAYLPSTipTkP3nw5cox0 cZJqfmscgsptitCnjEjp1rgkts1ohrgprtAJN895/UcTeQdWpJMRB+FHlLsb1sm8YQf6xk zC4frp9DY3pAkP+tvPIPtmH6tb5F0DdyaqM92jaUXqkpFwZBSO1CVoPLBMhHItVa1Vrbls mioLfRy9hkRmBdhkDd2SljQzawj2aKH75Dxyzo4e8u/LiaZcM4d4+bCUiYz3tPdnNT4p14 gFc01ZtCi9nwvTtOnXrMj7HULGgpS0oT7/+via+l7M3QC+gNbsI7IbTi1klH5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765160773; 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: in-reply-to:in-reply-to:references:references; bh=ICyb8x5QN3CnqBLX8TzvP4SXOsRJJq+YsF3M6bZ5s9Y=; b=lRETurpeY/IfSiQbwhwMMu87C3BUhxkrc3uLrWj2UmRFlRRE8HOm9jdJayX7ik+HjaXdnC R0DsRqbVSd4Jx3CJL8jJYYlPGM3bNeO2Y4kvei6KHnwI6VLQXNUBloYR4rGGkr5olve7NY /q0CqGpBAoGXkHb/fUJzXIJWSu9KClZDqxGNcR2oTM+cZKtv3JZLOnlEZLd9hXqy8h5EGP DmKDI+7Etn97w4mj3AUws5r8BtyHqY3XbJoKk6lLDtKBnV/FaRfJv3YI1k2AyODHJkHUZa rICptHRNcn8brstI55HTdhwY8NM9sMyXUVZ0fFE+4xMErRRW1+QnhZXt+vPNBg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765160773; a=rsa-sha256; cv=none; b=A9LgyKBtORLGdwJGpA5jgogY7U8sHOlFAoIV9tWmaKw8bwiUXMQNDlW7dtW6shFqxy6XQC 5SsbPkWg6B5o2bOZqPAN/iwHrYgGosMYaFELhVvVqYc12RHWru2gCKHeqI0fFQJ29B6zI2 Ch9Te6zDLruD9H3N/yEQ4P9CmRAChngSGTP/1nzjEsWi6eeAsHLNVFRbOQVqQ3WSlVjF8b vyhP36pWZpCCH39x9wYSYA1E/r94MKjp+7GA6ay4RM4tTxVwU+NjBOgJcNKeKGms1M6hjv hG07hLJgDcPIXxhXFF6XGKFXNYOT+m4fdmRD67pLHuaaLe3ZzzcXULj/Ad3IQw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 4dPm7T2n1tz17jx for ; Mon, 08 Dec 2025 02:26:13 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 5B82QDdJ077837 for ; Mon, 8 Dec 2025 02:26:13 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 5B82QDMm077835 for riscv@FreeBSD.org; Mon, 8 Dec 2025 02:26:13 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: riscv@FreeBSD.org Subject: [Bug 291446] /libexec/ld-elf.so.1 not branded properly on riscv, breaks manual activation via ldd Date: Mon, 08 Dec 2025 02:26:13 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: riscv X-Bugzilla-Version: 15.0-CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: jrtc27@freebsd.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: riscv@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: FreeBSD on the RISC-V instruction set architecture List-Archive: https://lists.freebsd.org/archives/freebsd-riscv List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: freebsd-riscv@freebsd.org Sender: owner-freebsd-riscv@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D291446 --- Comment #7 from Jessica Clarke --- I remembered c86af2cc4cd1 ("imgact_elf: Check note body sizes"), which looks like it has an off-by-one to me. Well, it sort of preserves an off-by-one t= hat was there if the data was zero length and the name size was already rounded. Effectively as of that commit it ignores the final note in a well-formed object. Can you try a kernel with the following: diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c index 779158b41221..f1d848e95f18 100644 --- a/sys/kern/imgact_elf.c +++ b/sys/kern/imgact_elf.c @@ -2840,7 +2840,7 @@ __elfN(parse_notes)(const struct image_params *imgp, const Elf_Note *checknote, goto nextnote; note_name =3D (const char *)(note + 1); if (note_name + roundup2(note->n_namesz, ELF_NOTE_ROUNDSIZE= ) + - note->n_descsz >=3D (const char *)note_end || + note->n_descsz > (const char *)note_end || strncmp(note_vendor, note_name, checknote->n_namesz) != =3D 0) goto nextnote; --=20 You are receiving this mail because: You are the assignee for the bug.=