From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id DCD3A385C6FE; Wed, 30 Aug 2023 12:37:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DCD3A385C6FE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1693399049; bh=BkYqbr6v2i2bOzGum1XvcLfV1QJWCXlwUiccLdV72BM=; h=From:To:Subject:Date:From; b=P/TwyK8swQA9YW3h+b9MVZTMJMgR3j4EJ/Ehj6G/Srbl3tKWDaTNS8rW9/UGjnQOI LokJ3PREZtN7aFPJ3/mQNGP26kPaBOGbKlAGElkMbkRKdf0/OB2pUJAM/QRUgt417O KDJTJJf4EEm7Ghv/dfL/PaqkcKAFYg6D3gbjaVRE= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Adhemerval Zanella To: glibc-cvs@sourceware.org Subject: [glibc/azanella/clang] x86: Add inhibit_stack_protector on ifunc handlers X-Act-Checkin: glibc X-Git-Author: Adhemerval Zanella X-Git-Refname: refs/heads/azanella/clang X-Git-Oldrev: 4bef870999a8a9ed42e82c5b925ac1303f00b722 X-Git-Newrev: 2297ec3265a1c1ce87495f1b0f9fd30aa10c26c3 Message-Id: <20230830123729.DCD3A385C6FE@sourceware.org> Date: Wed, 30 Aug 2023 12:37:29 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=2297ec3265a1c1ce87495f1b0f9fd30aa10c26c3 commit 2297ec3265a1c1ce87495f1b0f9fd30aa10c26c3 Author: Adhemerval Zanella Date: Thu Aug 4 09:41:29 2022 -0300 x86: Add inhibit_stack_protector on ifunc handlers Diff: --- sysdeps/i386/i686/multiarch/ifunc-memmove.h | 1 + sysdeps/i386/i686/multiarch/ifunc-memset.h | 1 + sysdeps/i386/i686/multiarch/ifunc-sse2-bsf.h | 1 + sysdeps/i386/i686/multiarch/ifunc-sse2-ssse3.h | 1 + sysdeps/i386/i686/multiarch/ifunc-sse2.h | 1 + sysdeps/i386/i686/multiarch/ifunc-sse4_2.h | 1 + sysdeps/i386/i686/multiarch/ifunc-ssse3-sse4_2.h | 1 + sysdeps/x86_64/fpu/multiarch/ifunc-avx-fma4.h | 1 + sysdeps/x86_64/fpu/multiarch/ifunc-fma.h | 1 + sysdeps/x86_64/fpu/multiarch/ifunc-fma4.h | 1 + sysdeps/x86_64/fpu/multiarch/ifunc-sse4_1.h | 1 + sysdeps/x86_64/multiarch/ifunc-avx2.h | 1 + sysdeps/x86_64/multiarch/ifunc-evex.h | 1 + sysdeps/x86_64/multiarch/ifunc-memcmp.h | 1 + sysdeps/x86_64/multiarch/ifunc-memmove.h | 1 + sysdeps/x86_64/multiarch/ifunc-memset.h | 1 + sysdeps/x86_64/multiarch/ifunc-sse4_2.h | 1 + sysdeps/x86_64/multiarch/ifunc-strcasecmp.h | 1 + sysdeps/x86_64/multiarch/ifunc-strcpy.h | 1 + sysdeps/x86_64/multiarch/ifunc-strncpy.h | 1 + sysdeps/x86_64/multiarch/ifunc-wcs.h | 1 + sysdeps/x86_64/multiarch/ifunc-wcslen.h | 1 + sysdeps/x86_64/multiarch/ifunc-wmemset.h | 1 + sysdeps/x86_64/multiarch/strchr.c | 1 + sysdeps/x86_64/multiarch/strcmp.c | 1 + sysdeps/x86_64/multiarch/strncmp.c | 1 + sysdeps/x86_64/multiarch/strstr.c | 1 + sysdeps/x86_64/multiarch/wcscpy.c | 1 + 28 files changed, 28 insertions(+) diff --git a/sysdeps/i386/i686/multiarch/ifunc-memmove.h b/sysdeps/i386/i686/multiarch/ifunc-memmove.h index 9d5ef2bffe..3e2d02ba68 100644 --- a/sysdeps/i386/i686/multiarch/ifunc-memmove.h +++ b/sysdeps/i386/i686/multiarch/ifunc-memmove.h @@ -26,6 +26,7 @@ extern __typeof (REDIRECT_NAME) OPTIMIZE (ssse3) attribute_hidden; extern __typeof (REDIRECT_NAME) OPTIMIZE (ssse3_rep) attribute_hidden; static inline void * +inhibit_stack_protector IFUNC_SELECTOR (void) { const struct cpu_features* cpu_features = __get_cpu_features (); diff --git a/sysdeps/i386/i686/multiarch/ifunc-memset.h b/sysdeps/i386/i686/multiarch/ifunc-memset.h index e3be29f411..a3f452422c 100644 --- a/sysdeps/i386/i686/multiarch/ifunc-memset.h +++ b/sysdeps/i386/i686/multiarch/ifunc-memset.h @@ -24,6 +24,7 @@ extern __typeof (REDIRECT_NAME) OPTIMIZE (sse2) attribute_hidden; extern __typeof (REDIRECT_NAME) OPTIMIZE (sse2_rep) attribute_hidden; static inline void * +inhibit_stack_protector IFUNC_SELECTOR (void) { const struct cpu_features* cpu_features = __get_cpu_features (); diff --git a/sysdeps/i386/i686/multiarch/ifunc-sse2-bsf.h b/sysdeps/i386/i686/multiarch/ifunc-sse2-bsf.h index d3a71627f6..7862ff0cf1 100644 --- a/sysdeps/i386/i686/multiarch/ifunc-sse2-bsf.h +++ b/sysdeps/i386/i686/multiarch/ifunc-sse2-bsf.h @@ -24,6 +24,7 @@ extern __typeof (REDIRECT_NAME) OPTIMIZE (sse2) attribute_hidden; extern __typeof (REDIRECT_NAME) OPTIMIZE (sse2_bsf) attribute_hidden; static inline void * +inhibit_stack_protector IFUNC_SELECTOR (void) { const struct cpu_features* cpu_features = __get_cpu_features (); diff --git a/sysdeps/i386/i686/multiarch/ifunc-sse2-ssse3.h b/sysdeps/i386/i686/multiarch/ifunc-sse2-ssse3.h index 75560c0dfd..1cb8c5dfca 100644 --- a/sysdeps/i386/i686/multiarch/ifunc-sse2-ssse3.h +++ b/sysdeps/i386/i686/multiarch/ifunc-sse2-ssse3.h @@ -25,6 +25,7 @@ extern __typeof (REDIRECT_NAME) OPTIMIZE (sse2) attribute_hidden; extern __typeof (REDIRECT_NAME) OPTIMIZE (ssse3) attribute_hidden; static inline void * +inhibit_stack_protector IFUNC_SELECTOR (void) { const struct cpu_features* cpu_features = __get_cpu_features (); diff --git a/sysdeps/i386/i686/multiarch/ifunc-sse2.h b/sysdeps/i386/i686/multiarch/ifunc-sse2.h index 1ea7892d73..b7e9783c98 100644 --- a/sysdeps/i386/i686/multiarch/ifunc-sse2.h +++ b/sysdeps/i386/i686/multiarch/ifunc-sse2.h @@ -23,6 +23,7 @@ extern __typeof (REDIRECT_NAME) OPTIMIZE (ia32) attribute_hidden; extern __typeof (REDIRECT_NAME) OPTIMIZE (sse2) attribute_hidden; static inline void * +inhibit_stack_protector IFUNC_SELECTOR (void) { const struct cpu_features* cpu_features = __get_cpu_features (); diff --git a/sysdeps/i386/i686/multiarch/ifunc-sse4_2.h b/sysdeps/i386/i686/multiarch/ifunc-sse4_2.h index e2438ce584..e9fa6b15d0 100644 --- a/sysdeps/i386/i686/multiarch/ifunc-sse4_2.h +++ b/sysdeps/i386/i686/multiarch/ifunc-sse4_2.h @@ -23,6 +23,7 @@ extern __typeof (REDIRECT_NAME) OPTIMIZE (ia32) attribute_hidden; extern __typeof (REDIRECT_NAME) OPTIMIZE (sse42) attribute_hidden; static inline void * +inhibit_stack_protector IFUNC_SELECTOR (void) { const struct cpu_features* cpu_features = __get_cpu_features (); diff --git a/sysdeps/i386/i686/multiarch/ifunc-ssse3-sse4_2.h b/sysdeps/i386/i686/multiarch/ifunc-ssse3-sse4_2.h index 563e1648b5..ae7971008e 100644 --- a/sysdeps/i386/i686/multiarch/ifunc-ssse3-sse4_2.h +++ b/sysdeps/i386/i686/multiarch/ifunc-ssse3-sse4_2.h @@ -25,6 +25,7 @@ extern __typeof (REDIRECT_NAME) OPTIMIZE (ssse3) attribute_hidden; extern __typeof (REDIRECT_NAME) OPTIMIZE (sse4_2) attribute_hidden; static inline void * +inhibit_stack_protector IFUNC_SELECTOR (void) { const struct cpu_features* cpu_features = __get_cpu_features (); diff --git a/sysdeps/x86_64/fpu/multiarch/ifunc-avx-fma4.h b/sysdeps/x86_64/fpu/multiarch/ifunc-avx-fma4.h index 2ef833a3c3..f9168feb38 100644 --- a/sysdeps/x86_64/fpu/multiarch/ifunc-avx-fma4.h +++ b/sysdeps/x86_64/fpu/multiarch/ifunc-avx-fma4.h @@ -25,6 +25,7 @@ extern __typeof (REDIRECT_NAME) OPTIMIZE (fma) attribute_hidden; extern __typeof (REDIRECT_NAME) OPTIMIZE (fma4) attribute_hidden; static inline void * +inhibit_stack_protector IFUNC_SELECTOR (void) { const struct cpu_features* cpu_features = __get_cpu_features (); diff --git a/sysdeps/x86_64/fpu/multiarch/ifunc-fma.h b/sysdeps/x86_64/fpu/multiarch/ifunc-fma.h index 54875812a0..b5f2452eb8 100644 --- a/sysdeps/x86_64/fpu/multiarch/ifunc-fma.h +++ b/sysdeps/x86_64/fpu/multiarch/ifunc-fma.h @@ -22,6 +22,7 @@ extern __typeof (REDIRECT_NAME) OPTIMIZE (sse2) attribute_hidden; extern __typeof (REDIRECT_NAME) OPTIMIZE (fma) attribute_hidden; static inline void * +inhibit_stack_protector IFUNC_SELECTOR (void) { const struct cpu_features* cpu_features = __get_cpu_features (); diff --git a/sysdeps/x86_64/fpu/multiarch/ifunc-fma4.h b/sysdeps/x86_64/fpu/multiarch/ifunc-fma4.h index 9a918e3acc..6ec3d2aff5 100644 --- a/sysdeps/x86_64/fpu/multiarch/ifunc-fma4.h +++ b/sysdeps/x86_64/fpu/multiarch/ifunc-fma4.h @@ -24,6 +24,7 @@ extern __typeof (REDIRECT_NAME) OPTIMIZE (fma) attribute_hidden; extern __typeof (REDIRECT_NAME) OPTIMIZE (fma4) attribute_hidden; static inline void * +inhibit_stack_protector IFUNC_SELECTOR (void) { const struct cpu_features* cpu_features = __get_cpu_features (); diff --git a/sysdeps/x86_64/fpu/multiarch/ifunc-sse4_1.h b/sysdeps/x86_64/fpu/multiarch/ifunc-sse4_1.h index deaefb01a1..4daf78aa4c 100644 --- a/sysdeps/x86_64/fpu/multiarch/ifunc-sse4_1.h +++ b/sysdeps/x86_64/fpu/multiarch/ifunc-sse4_1.h @@ -22,6 +22,7 @@ extern __typeof (REDIRECT_NAME) OPTIMIZE (c) attribute_hidden; extern __typeof (REDIRECT_NAME) OPTIMIZE (sse41) attribute_hidden; static inline void * +inhibit_stack_protector IFUNC_SELECTOR (void) { const struct cpu_features* cpu_features = __get_cpu_features (); diff --git a/sysdeps/x86_64/multiarch/ifunc-avx2.h b/sysdeps/x86_64/multiarch/ifunc-avx2.h index c4e02ba7f8..337fb768e0 100644 --- a/sysdeps/x86_64/multiarch/ifunc-avx2.h +++ b/sysdeps/x86_64/multiarch/ifunc-avx2.h @@ -31,6 +31,7 @@ extern __typeof (REDIRECT_NAME) OPTIMIZE (avx2_rtm) attribute_hidden; extern __typeof (REDIRECT_NAME) OPTIMIZE (GENERIC) attribute_hidden; static inline void * +inhibit_stack_protector IFUNC_SELECTOR (void) { const struct cpu_features *cpu_features = __get_cpu_features (); diff --git a/sysdeps/x86_64/multiarch/ifunc-evex.h b/sysdeps/x86_64/multiarch/ifunc-evex.h index 0752b65fdd..160a37c790 100644 --- a/sysdeps/x86_64/multiarch/ifunc-evex.h +++ b/sysdeps/x86_64/multiarch/ifunc-evex.h @@ -28,6 +28,7 @@ extern __typeof (REDIRECT_NAME) OPTIMIZE (avx2_rtm) attribute_hidden; extern __typeof (REDIRECT_NAME) OPTIMIZE (sse2) attribute_hidden; static inline void * +inhibit_stack_protector IFUNC_SELECTOR (void) { const struct cpu_features *cpu_features = __get_cpu_features (); diff --git a/sysdeps/x86_64/multiarch/ifunc-memcmp.h b/sysdeps/x86_64/multiarch/ifunc-memcmp.h index 5f376640a7..43955dcb5d 100644 --- a/sysdeps/x86_64/multiarch/ifunc-memcmp.h +++ b/sysdeps/x86_64/multiarch/ifunc-memcmp.h @@ -27,6 +27,7 @@ extern __typeof (REDIRECT_NAME) OPTIMIZE (avx2_movbe_rtm) attribute_hidden; extern __typeof (REDIRECT_NAME) OPTIMIZE (sse2) attribute_hidden; static inline void * +inhibit_stack_protector IFUNC_SELECTOR (void) { const struct cpu_features *cpu_features = __get_cpu_features (); diff --git a/sysdeps/x86_64/multiarch/ifunc-memmove.h b/sysdeps/x86_64/multiarch/ifunc-memmove.h index f76f5fdbc5..32ea48e447 100644 --- a/sysdeps/x86_64/multiarch/ifunc-memmove.h +++ b/sysdeps/x86_64/multiarch/ifunc-memmove.h @@ -49,6 +49,7 @@ extern __typeof (REDIRECT_NAME) OPTIMIZE (sse2_unaligned_erms) attribute_hidden; static inline void * +inhibit_stack_protector IFUNC_SELECTOR (void) { const struct cpu_features *cpu_features = __get_cpu_features (); diff --git a/sysdeps/x86_64/multiarch/ifunc-memset.h b/sysdeps/x86_64/multiarch/ifunc-memset.h index 5c5096ec5a..47e240a568 100644 --- a/sysdeps/x86_64/multiarch/ifunc-memset.h +++ b/sysdeps/x86_64/multiarch/ifunc-memset.h @@ -47,6 +47,7 @@ extern __typeof (REDIRECT_NAME) OPTIMIZE (sse2_unaligned_erms) attribute_hidden; static inline void * +inhibit_stack_protector IFUNC_SELECTOR (void) { const struct cpu_features *cpu_features = __get_cpu_features (); diff --git a/sysdeps/x86_64/multiarch/ifunc-sse4_2.h b/sysdeps/x86_64/multiarch/ifunc-sse4_2.h index a55a833e91..38f92f81d3 100644 --- a/sysdeps/x86_64/multiarch/ifunc-sse4_2.h +++ b/sysdeps/x86_64/multiarch/ifunc-sse4_2.h @@ -23,6 +23,7 @@ extern __typeof (REDIRECT_NAME) OPTIMIZE (generic) attribute_hidden; extern __typeof (REDIRECT_NAME) OPTIMIZE (sse42) attribute_hidden; static inline void * +inhibit_stack_protector IFUNC_SELECTOR (void) { const struct cpu_features* cpu_features = __get_cpu_features (); diff --git a/sysdeps/x86_64/multiarch/ifunc-strcasecmp.h b/sysdeps/x86_64/multiarch/ifunc-strcasecmp.h index 89d366b7b5..977983e9bc 100644 --- a/sysdeps/x86_64/multiarch/ifunc-strcasecmp.h +++ b/sysdeps/x86_64/multiarch/ifunc-strcasecmp.h @@ -29,6 +29,7 @@ extern __typeof (REDIRECT_NAME) OPTIMIZE (sse42) attribute_hidden; extern __typeof (REDIRECT_NAME) OPTIMIZE (sse2) attribute_hidden; static inline void * +inhibit_stack_protector IFUNC_SELECTOR (void) { const struct cpu_features *cpu_features = __get_cpu_features (); diff --git a/sysdeps/x86_64/multiarch/ifunc-strcpy.h b/sysdeps/x86_64/multiarch/ifunc-strcpy.h index 82140c85ad..54bfe5cf47 100644 --- a/sysdeps/x86_64/multiarch/ifunc-strcpy.h +++ b/sysdeps/x86_64/multiarch/ifunc-strcpy.h @@ -31,6 +31,7 @@ extern __typeof (REDIRECT_NAME) extern __typeof (REDIRECT_NAME) OPTIMIZE (sse2) attribute_hidden; static inline void * +inhibit_stack_protector IFUNC_SELECTOR (void) { const struct cpu_features *cpu_features = __get_cpu_features (); diff --git a/sysdeps/x86_64/multiarch/ifunc-strncpy.h b/sysdeps/x86_64/multiarch/ifunc-strncpy.h index c32c80498c..97b0980aa7 100644 --- a/sysdeps/x86_64/multiarch/ifunc-strncpy.h +++ b/sysdeps/x86_64/multiarch/ifunc-strncpy.h @@ -28,6 +28,7 @@ extern __typeof (REDIRECT_NAME) OPTIMIZE (sse2_unaligned) attribute_hidden; static inline void * +inhibit_stack_protector IFUNC_SELECTOR (void) { const struct cpu_features *cpu_features = __get_cpu_features (); diff --git a/sysdeps/x86_64/multiarch/ifunc-wcs.h b/sysdeps/x86_64/multiarch/ifunc-wcs.h index e6b3faf609..e6eabcf2a6 100644 --- a/sysdeps/x86_64/multiarch/ifunc-wcs.h +++ b/sysdeps/x86_64/multiarch/ifunc-wcs.h @@ -32,6 +32,7 @@ extern __typeof (REDIRECT_NAME) OPTIMIZE (avx2) attribute_hidden; extern __typeof (REDIRECT_NAME) OPTIMIZE (GENERIC) attribute_hidden; static inline void * +inhibit_stack_protector IFUNC_SELECTOR (void) { const struct cpu_features *cpu_features = __get_cpu_features (); diff --git a/sysdeps/x86_64/multiarch/ifunc-wcslen.h b/sysdeps/x86_64/multiarch/ifunc-wcslen.h index dcc354bf01..d4fd90ba02 100644 --- a/sysdeps/x86_64/multiarch/ifunc-wcslen.h +++ b/sysdeps/x86_64/multiarch/ifunc-wcslen.h @@ -33,6 +33,7 @@ extern __typeof (REDIRECT_NAME) OPTIMIZE (sse4_1) attribute_hidden; extern __typeof (REDIRECT_NAME) OPTIMIZE (GENERIC) attribute_hidden; static inline void * +inhibit_stack_protector IFUNC_SELECTOR (void) { const struct cpu_features *cpu_features = __get_cpu_features (); diff --git a/sysdeps/x86_64/multiarch/ifunc-wmemset.h b/sysdeps/x86_64/multiarch/ifunc-wmemset.h index 1fbbd3d68e..5b442b60fd 100644 --- a/sysdeps/x86_64/multiarch/ifunc-wmemset.h +++ b/sysdeps/x86_64/multiarch/ifunc-wmemset.h @@ -29,6 +29,7 @@ extern __typeof (REDIRECT_NAME) OPTIMIZE (avx2_unaligned_rtm) extern __typeof (REDIRECT_NAME) OPTIMIZE (sse2_unaligned) attribute_hidden; static inline void * +inhibit_stack_protector IFUNC_SELECTOR (void) { const struct cpu_features *cpu_features = __get_cpu_features (); diff --git a/sysdeps/x86_64/multiarch/strchr.c b/sysdeps/x86_64/multiarch/strchr.c index 310dfe68b6..b9f9015dcb 100644 --- a/sysdeps/x86_64/multiarch/strchr.c +++ b/sysdeps/x86_64/multiarch/strchr.c @@ -35,6 +35,7 @@ extern __typeof (REDIRECT_NAME) OPTIMIZE (sse2) attribute_hidden; extern __typeof (REDIRECT_NAME) OPTIMIZE (sse2_no_bsf) attribute_hidden; static inline void * +inhibit_stack_protector IFUNC_SELECTOR (void) { const struct cpu_features *cpu_features = __get_cpu_features (); diff --git a/sysdeps/x86_64/multiarch/strcmp.c b/sysdeps/x86_64/multiarch/strcmp.c index 03f533c607..5f19c3af19 100644 --- a/sysdeps/x86_64/multiarch/strcmp.c +++ b/sysdeps/x86_64/multiarch/strcmp.c @@ -40,6 +40,7 @@ extern __typeof (REDIRECT_NAME) OPTIMIZE (sse2) attribute_hidden; static inline void * +inhibit_stack_protector IFUNC_SELECTOR (void) { const struct cpu_features *cpu_features = __get_cpu_features (); diff --git a/sysdeps/x86_64/multiarch/strncmp.c b/sysdeps/x86_64/multiarch/strncmp.c index f7ea49f082..df2f157487 100644 --- a/sysdeps/x86_64/multiarch/strncmp.c +++ b/sysdeps/x86_64/multiarch/strncmp.c @@ -36,6 +36,7 @@ extern __typeof (REDIRECT_NAME) OPTIMIZE (sse42) attribute_hidden; extern __typeof (REDIRECT_NAME) OPTIMIZE (sse2) attribute_hidden; static inline void * +inhibit_stack_protector IFUNC_SELECTOR (void) { const struct cpu_features *cpu_features = __get_cpu_features (); diff --git a/sysdeps/x86_64/multiarch/strstr.c b/sysdeps/x86_64/multiarch/strstr.c index 7c7a320f88..0e5c38cc73 100644 --- a/sysdeps/x86_64/multiarch/strstr.c +++ b/sysdeps/x86_64/multiarch/strstr.c @@ -43,6 +43,7 @@ extern __typeof (__redirect_strstr) __strstr_avx512 attribute_hidden; extern __typeof (__redirect_strstr) __libc_strstr; static inline void * +inhibit_stack_protector IFUNC_SELECTOR (void) { const struct cpu_features *cpu_features = __get_cpu_features (); diff --git a/sysdeps/x86_64/multiarch/wcscpy.c b/sysdeps/x86_64/multiarch/wcscpy.c index abbedb88ea..15a0d5278e 100644 --- a/sysdeps/x86_64/multiarch/wcscpy.c +++ b/sysdeps/x86_64/multiarch/wcscpy.c @@ -35,6 +35,7 @@ extern __typeof (REDIRECT_NAME) OPTIMIZE (ssse3) attribute_hidden; extern __typeof (REDIRECT_NAME) OPTIMIZE (generic) attribute_hidden; static inline void * +inhibit_stack_protector IFUNC_SELECTOR (void) { const struct cpu_features* cpu_features = __get_cpu_features ();