From patchwork Sat Aug 12 12:05:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 22110 Received: (qmail 117923 invoked by alias); 12 Aug 2017 12:05:18 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 117911 invoked by uid 89); 12 Aug 2017 12:05:17 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 29A16C07F980 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=fweimer@redhat.com Date: Sat, 12 Aug 2017 14:05:13 +0200 To: libc-alpha@sourceware.org Subject: [PATCH] __fortify_fail: Remove internal_function attribute User-Agent: Heirloom mailx 12.5 7/5/10 MIME-Version: 1.0 Message-Id: <20170812120513.F37704027587E@oldenburg.str.redhat.com> From: fweimer@redhat.com (Florian Weimer) __fortify_fail is called across DSO boundaries, so it should not use a non-standard calling convention. 2017-08-12 Florian Weimer * debug/fortify_fail.c (__fortify_fail, __fortify_fail_abort): Remove internal_function. * include/stdio.h (__fortify_fail, __fortify_fail_abort): Likewise. * sysdeps/mach/hurd/i386/____longjmp_chk.S (CALL_FAIL): Pass message argument on the stack. * sysdeps/unix/sysv/linux/i386/____longjmp_chk.S (CALL_FAIL): Likeweise. diff --git a/debug/fortify_fail.c b/debug/fortify_fail.c index a0777ae570..add5625faf 100644 --- a/debug/fortify_fail.c +++ b/debug/fortify_fail.c @@ -23,7 +23,7 @@ extern char **__libc_argv attribute_hidden; void -__attribute__ ((noreturn)) internal_function +__attribute__ ((noreturn)) __fortify_fail_abort (_Bool need_backtrace, const char *msg) { /* The loop is added only to keep gcc happy. Don't pass down @@ -38,7 +38,7 @@ __fortify_fail_abort (_Bool need_backtrace, const char *msg) } void -__attribute__ ((noreturn)) internal_function +__attribute__ ((noreturn)) __fortify_fail (const char *msg) { __fortify_fail_abort (true, msg); diff --git a/include/stdio.h b/include/stdio.h index 215f919990..509447c528 100644 --- a/include/stdio.h +++ b/include/stdio.h @@ -98,10 +98,9 @@ extern void __libc_fatal (const char *__message) __attribute__ ((__noreturn__)); extern void __libc_message (enum __libc_message_action action, const char *__fnt, ...); -extern void __fortify_fail (const char *msg) - __attribute__ ((__noreturn__)) internal_function; +extern void __fortify_fail (const char *msg) __attribute__ ((__noreturn__)); extern void __fortify_fail_abort (_Bool, const char *msg) - __attribute__ ((__noreturn__)) internal_function; + __attribute__ ((__noreturn__)); libc_hidden_proto (__fortify_fail) libc_hidden_proto (__fortify_fail_abort) diff --git a/sysdeps/mach/hurd/i386/____longjmp_chk.S b/sysdeps/mach/hurd/i386/____longjmp_chk.S index ac28c94e13..e7c988254f 100644 --- a/sysdeps/mach/hurd/i386/____longjmp_chk.S +++ b/sysdeps/mach/hurd/i386/____longjmp_chk.S @@ -36,9 +36,11 @@ longjmp_msg: cfi_register(%ebx,%ecx); \ LOAD_PIC_REG (bx); \ leal longjmp_msg@GOTOFF(%ebx), %eax; \ + movl %eax, (%esp); \ call HIDDEN_JUMPTARGET(__fortify_fail) #else # define CALL_FAIL movl $longjmp_msg, %eax; \ + movl %eax, (%esp); \ call HIDDEN_JUMPTARGET(__fortify_fail) #endif diff --git a/sysdeps/unix/sysv/linux/i386/____longjmp_chk.S b/sysdeps/unix/sysv/linux/i386/____longjmp_chk.S index d46ea84e30..2e4427abc8 100644 --- a/sysdeps/unix/sysv/linux/i386/____longjmp_chk.S +++ b/sysdeps/unix/sysv/linux/i386/____longjmp_chk.S @@ -33,9 +33,11 @@ longjmp_msg: cfi_register(%ebx,%ecx); \ LOAD_PIC_REG (bx); \ leal longjmp_msg@GOTOFF(%ebx), %eax; \ + movl %eax, (%esp); \ call HIDDEN_JUMPTARGET(__fortify_fail) #else # define CALL_FAIL movl $longjmp_msg, %eax; \ + movl %eax, (%esp); \ call HIDDEN_JUMPTARGET(__fortify_fail) #endif