From nobody Wed Jan 04 22:55:34 2023 X-Original-To: dev-commits-src-main@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 4NnQ1M3Q8wz2pMkS; Wed, 4 Jan 2023 22:55:35 +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 4NnQ1M27Yfz3h5f; Wed, 4 Jan 2023 22:55:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1672872935; 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=I4MJTcSYbtRkBBLT6BxSm2DJire9msqJmQ6QAkAxnVk=; b=KNWXppNweH4Y5yc9VA1tLkY552OysPWC1LBRKaLlkoiEDYFvNM2YGwJuNHYpAKp6wz6k8I 96HSMY9wCLfoKYcZ8ExjZ5Ph1dkgPqPqzsIiRdc7Kx9ITLgEngKz69gWNDayqd2CHxDAlt I0EHfKCYZVE3zTlePtzxiRW1IBelEosawM41yhpkTJBIHR1htHLNmDaiC9QfnybwMkPWgb DqAXlVj2ANX6c68FgqFfKNxwf99SjfuSH2Vx8I0MNtuEnBlhDcj43VU31hqPq/fxUXdvDk OVlERKTKJMFX3tvtcDAheL3YXRpj/SYothFDFZTz3FGnX5U9b9QHywKXlceDEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1672872935; 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=I4MJTcSYbtRkBBLT6BxSm2DJire9msqJmQ6QAkAxnVk=; b=BhB9mS4wDoZCeuiR7uvNVdyZ6kyjXKhd6bZPj6TGwG+reqKMfYonmFr3IlmlcYaZBTpg+k Nrz2lvHhSydBFTvumm5VcdRmoUrf9JHSPtAGliwbkWcUXr8RGZFfjThpPtjpoN81+u9PA9 362beJjmI3VMqrRO99wGH57/YAQMiU4qbyNlLZLFBZiGW/MI2/7AbMG3OMnzIdvmPxSaiw N5Is8VmpVhuPIImH/ewZM3tEgToOyljVEJXjS+BYQWhSq1mkzvqaUbcxcs/XfEIdK5GlKl ZAXSbTF3OpESyZhJRFvxMYZ760NVL8XSjqbQ+uUCirrYMrmd4onfsZBcw322Dg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1672872935; a=rsa-sha256; cv=none; b=vA6WauMTe5iZlT5d6mrA0m0q/nec3apkEH4nRfDjgjTRO/bfJ1FnS09oP808i7ZtLilBUK oeftmBWrc4hx2Rt1nbm6LrNoCUcI31J/koM0o/ur9ODCPTL1PpnljUXD9/wIbWzxbL+6Ke nX4pl4AogQE0zv2eHyT1DBJs8q3Ka4j8tS549dKFAWpxQD2CyVSS2y7e1LPiS5Qwlz28Y+ iIETzSsjcFnD2t6PkDZ6UyQcDYCyZWVxticyUSvGhtg2jolUDjkp2lYl57mgpVnrP1j26P Dc5SJZETRWzGmY+vNnURlLCpBRs/XGxFee4ppXokLCKIp5vqcPZYuwCgukQOWw== 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 4NnQ1M0dPPzT5J; Wed, 4 Jan 2023 22:55:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 304MtY9C002416; Wed, 4 Jan 2023 22:55:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 304MtY3G002415; Wed, 4 Jan 2023 22:55:34 GMT (envelope-from git) Date: Wed, 4 Jan 2023 22:55:34 GMT Message-Id: <202301042255.304MtY3G002415@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: b069d3e01931 - main - rtld: Revert "When loading dso without PT_GNU_STACK phdr, only call" List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b069d3e0193121ff6de348f68c7ce93ee61e5e2f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=b069d3e0193121ff6de348f68c7ce93ee61e5e2f commit b069d3e0193121ff6de348f68c7ce93ee61e5e2f Author: John Baldwin AuthorDate: 2023-01-04 22:55:00 +0000 Commit: John Baldwin CommitDate: 2023-01-04 22:55:00 +0000 rtld: Revert "When loading dso without PT_GNU_STACK phdr, only call" After the removal of ia64 and sparc64, all current architectures support executable stacks at an architectural level. This reverts commit 1290d38ac50b3afa7e5781d9d97346a1042c736c. Reviewed by: kib Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D37904 --- libexec/rtld-elf/aarch64/rtld_machdep.h | 3 --- libexec/rtld-elf/amd64/rtld_machdep.h | 3 --- libexec/rtld-elf/arm/rtld_machdep.h | 3 --- libexec/rtld-elf/i386/rtld_machdep.h | 3 --- libexec/rtld-elf/map_object.c | 2 +- libexec/rtld-elf/powerpc/rtld_machdep.h | 3 --- libexec/rtld-elf/powerpc64/rtld_machdep.h | 3 --- libexec/rtld-elf/riscv/rtld_machdep.h | 3 --- libexec/rtld-elf/rtld.c | 2 +- 9 files changed, 2 insertions(+), 23 deletions(-) diff --git a/libexec/rtld-elf/aarch64/rtld_machdep.h b/libexec/rtld-elf/aarch64/rtld_machdep.h index ce6f6fc6c7c0..8fed482340b7 100644 --- a/libexec/rtld-elf/aarch64/rtld_machdep.h +++ b/libexec/rtld-elf/aarch64/rtld_machdep.h @@ -87,9 +87,6 @@ typedef struct { extern void *__tls_get_addr(tls_index *ti); -#define RTLD_DEFAULT_STACK_PF_EXEC PF_X -#define RTLD_DEFAULT_STACK_EXEC PROT_EXEC - #define md_abi_variant_hook(x) #endif diff --git a/libexec/rtld-elf/amd64/rtld_machdep.h b/libexec/rtld-elf/amd64/rtld_machdep.h index 99f020e60221..e37301b8174a 100644 --- a/libexec/rtld-elf/amd64/rtld_machdep.h +++ b/libexec/rtld-elf/amd64/rtld_machdep.h @@ -69,9 +69,6 @@ typedef struct { void *__tls_get_addr(tls_index *ti) __exported; -#define RTLD_DEFAULT_STACK_PF_EXEC PF_X -#define RTLD_DEFAULT_STACK_EXEC PROT_EXEC - #define md_abi_variant_hook(x) size_t calculate_first_tls_offset(size_t size, size_t align, size_t offset); diff --git a/libexec/rtld-elf/arm/rtld_machdep.h b/libexec/rtld-elf/arm/rtld_machdep.h index c1acdd719e99..e4d68c360363 100644 --- a/libexec/rtld-elf/arm/rtld_machdep.h +++ b/libexec/rtld-elf/arm/rtld_machdep.h @@ -73,9 +73,6 @@ typedef struct { extern void *__tls_get_addr(tls_index *ti); -#define RTLD_DEFAULT_STACK_PF_EXEC PF_X -#define RTLD_DEFAULT_STACK_EXEC PROT_EXEC - #define md_abi_variant_hook(x) #endif diff --git a/libexec/rtld-elf/i386/rtld_machdep.h b/libexec/rtld-elf/i386/rtld_machdep.h index ee41e31bd591..9d62bc26eb5b 100644 --- a/libexec/rtld-elf/i386/rtld_machdep.h +++ b/libexec/rtld-elf/i386/rtld_machdep.h @@ -70,9 +70,6 @@ typedef struct { void *___tls_get_addr(tls_index *ti) __attribute__((__regparm__(1))) __exported; void *__tls_get_addr(tls_index *ti) __exported; -#define RTLD_DEFAULT_STACK_PF_EXEC PF_X -#define RTLD_DEFAULT_STACK_EXEC PROT_EXEC - #define md_abi_variant_hook(x) size_t calculate_first_tls_offset(size_t size, size_t align, size_t offset); diff --git a/libexec/rtld-elf/map_object.c b/libexec/rtld-elf/map_object.c index 7c637fe1d6ba..4bf32398710d 100644 --- a/libexec/rtld-elf/map_object.c +++ b/libexec/rtld-elf/map_object.c @@ -122,7 +122,7 @@ map_object(int fd, const char *path, const struct stat *sb) note_map = NULL; note_map_len = 0; segs = alloca(sizeof(segs[0]) * hdr->e_phnum); - stack_flags = RTLD_DEFAULT_STACK_PF_EXEC | PF_R | PF_W; + stack_flags = PF_X | PF_R | PF_W; text_end = 0; while (phdr < phlimit) { switch (phdr->p_type) { diff --git a/libexec/rtld-elf/powerpc/rtld_machdep.h b/libexec/rtld-elf/powerpc/rtld_machdep.h index b3e2e3fafa9f..44298ec2a127 100644 --- a/libexec/rtld-elf/powerpc/rtld_machdep.h +++ b/libexec/rtld-elf/powerpc/rtld_machdep.h @@ -89,9 +89,6 @@ typedef struct { extern void *__tls_get_addr(tls_index* ti); -#define RTLD_DEFAULT_STACK_PF_EXEC PF_X -#define RTLD_DEFAULT_STACK_EXEC PROT_EXEC - extern void powerpc_abi_variant_hook(Elf_Auxinfo **); #define md_abi_variant_hook(x) powerpc_abi_variant_hook(x) diff --git a/libexec/rtld-elf/powerpc64/rtld_machdep.h b/libexec/rtld-elf/powerpc64/rtld_machdep.h index c8dcebe45ae2..67c4810da93b 100644 --- a/libexec/rtld-elf/powerpc64/rtld_machdep.h +++ b/libexec/rtld-elf/powerpc64/rtld_machdep.h @@ -81,9 +81,6 @@ typedef struct { extern void *__tls_get_addr(tls_index* ti); -#define RTLD_DEFAULT_STACK_PF_EXEC PF_X -#define RTLD_DEFAULT_STACK_EXEC PROT_EXEC - extern void powerpc64_abi_variant_hook(Elf_Auxinfo **); #define md_abi_variant_hook(x) powerpc64_abi_variant_hook(x) diff --git a/libexec/rtld-elf/riscv/rtld_machdep.h b/libexec/rtld-elf/riscv/rtld_machdep.h index e422905f3850..2421b2f4108b 100644 --- a/libexec/rtld-elf/riscv/rtld_machdep.h +++ b/libexec/rtld-elf/riscv/rtld_machdep.h @@ -99,9 +99,6 @@ typedef struct { extern void *__tls_get_addr(tls_index* ti); -#define RTLD_DEFAULT_STACK_PF_EXEC PF_X -#define RTLD_DEFAULT_STACK_EXEC PROT_EXEC - #define md_abi_variant_hook(x) #endif diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 2a142d333740..7e4df3392ec7 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -269,7 +269,7 @@ static int osreldate; size_t *pagesizes; size_t page_size; -static int stack_prot = PROT_READ | PROT_WRITE | RTLD_DEFAULT_STACK_EXEC; +static int stack_prot = PROT_READ | PROT_WRITE | PROT_EXEC; static int max_stack_flags; /*