From nobody Mon Feb 19 16:45:19 2024 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 4TdpLR4hm6z5C9Kt; Mon, 19 Feb 2024 16:45:19 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdpLR3VHdz4bvh; Mon, 19 Feb 2024 16:45:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361119; 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=f0duNByO1neTvF46FBxzF9TKfIhtsR/noE8O7QKAk2c=; b=r/JiYKHg5Ev52oh0G0M0zKgvU/fuIBU4uSGSwChSfLZYUKLvRbLXnPHR5ReMENkXI4a/RK bE+lFLBS0zq/DJmC3sFarUKj+j7zhp0nahsQeL1CZBZYQ0FIzrpxJPkbhEQE0R/JIlfAA1 zMTPi3DR1ZuVq7hYnmJm/C61HIURRd0FvLFk/1QHBNCNmZ9D+XqT7O7UxhQw3Khacrwi0F 9udo4BlruUbE80jktrSu0KqYkSs+u72IWggSqg3GtcufSy9hLVlXv1l5yPNGUq1swYmAyi Rwzlfp9bi7hk8nEJRSUf035N4AkU9dIyY+FrHIw/ZFCJbBisrmrgiuyMv4F9lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361119; 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=f0duNByO1neTvF46FBxzF9TKfIhtsR/noE8O7QKAk2c=; b=LoF+H4bpdb7+/6FSNhXZ3gawXSwqk+DxOi2a3mTmTDHLeTBaOOOLxiSmbn8cgHj4Na7FlM gcSE7GtPXXbEJptM6jcC+iOzpS2bB+aGJa3jq+iItJl7sVinlbr6sOBW+qYypYaKBEcFOB Ri2l84fyD+2B1TsgUtHqteKMrWMIfRq5z23kU3yrS7huKKEDhVJonzs8A3fXzOHBw73jI3 yvDBI49aiw8HpmxG0+vNgF95X9qnw/Cqffce0C/LTSexJH4VUO5WkzosFUA0WZC0Dm8MHb lz5G6Uo+Zc/blieaYILZjM/ne8YjHs7Njs8mjxJAvH6vCtrAnyBkiKURbjz+rg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708361119; a=rsa-sha256; cv=none; b=pSNsD3ARi0HPIbq/fruztZsJ2O4LdN9xRCtbIGzLvIaoZafVxQzukSiZsOg6doeRXiuWHR WZrFehL1n6QQaHDyWH0VEZvp4a1L4kZCbUIHOGv5qlUukCbJoY0nQ2NF88DvjvrEyHPTEx c9xbdBtZCgJ7HnFUcrVwGJfF+VEpdiEUc6OPIsi0BaZFhq1EzGCqsMXzMks/Dy7oeS1tp8 E+HZSGzoTZY9ymqF02npFrI/wk1biG5iUN4AA51tYOlL+3VwgTLMo4n5yNkmPNYRIh7GbD TF0Js6ATpiExBmlL/eOxIvBEUY7xkqpWO4XHbCxvQm11sp9dD/tlGJ3bo+WZzw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 4TdpLR2c77zj9V; Mon, 19 Feb 2024 16:45:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JGjJIp096054; Mon, 19 Feb 2024 16:45:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGjJXt096051; Mon, 19 Feb 2024 16:45:19 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:45:19 GMT Message-Id: <202402191645.41JGjJXt096051@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 403c7ef8e853 - stable/14 - imgact_elf: Export __elfN(parse_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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 403c7ef8e853544227fc18d41fed6a019d26cc52 Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=403c7ef8e853544227fc18d41fed6a019d26cc52 commit 403c7ef8e853544227fc18d41fed6a019d26cc52 Author: Andrew Turner AuthorDate: 2023-11-01 15:18:12 +0000 Commit: Andrew Turner CommitDate: 2024-02-19 13:12:51 +0000 imgact_elf: Export __elfN(parse_notes) This is useful to check if a note is present and contains an expected value, e.g. to read NT_GNU_PROPERTY_TYPE_0 on arm64 to see if we should enable BTI. Reviewed by: kib, markj Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D42439 (cherry picked from commit a04633cef81e3b29da4eb214331bd472fc2e9238) --- sys/kern/imgact_elf.c | 2 +- sys/sys/imgact_elf.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c index 0b22e113b3d7..23ddf3ac717a 100644 --- a/sys/kern/imgact_elf.c +++ b/sys/kern/imgact_elf.c @@ -2704,7 +2704,7 @@ __elfN(note_procstat_auxv)(void *arg, struct sbuf *sb, size_t *sizep) } #define MAX_NOTES_LOOP 4096 -static bool +bool __elfN(parse_notes)(struct image_params *imgp, Elf_Note *checknote, const char *note_vendor, const Elf_Phdr *pnote, bool (*cb)(const Elf_Note *, void *, bool *), void *cb_arg) diff --git a/sys/sys/imgact_elf.h b/sys/sys/imgact_elf.h index 7210fc2187a9..51e149476a28 100644 --- a/sys/sys/imgact_elf.h +++ b/sys/sys/imgact_elf.h @@ -123,6 +123,9 @@ void __elfN(prepare_notes)(struct thread *, struct note_info_list *, void __elfN(size_segments)(struct thread *, struct sseg_closure *, int); size_t __elfN(register_note)(struct thread *, struct note_info_list *, int, outfunc_t, void *); +bool __elfN(parse_notes)(struct image_params *, Elf_Note *, const char *, + const Elf_Phdr *, bool (*)(const Elf_Note *, void *, bool *), + void *); /* Machine specific function to dump per-thread information. */ void __elfN(dump_thread)(struct thread *, void *, size_t *);