public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Siddhesh Poyarekar <siddhesh@sourceware.org>
To: glibc-cvs@sourceware.org
Subject: [glibc] sysdeps/{i386, x86_64}/mempcpy_chk.S: fix linknamespace for __mempcpy_chk
Date: Thu, 22 Jun 2023 04:53:31 +0000 (GMT)	[thread overview]
Message-ID: <20230622045331.77A893858D28@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=1bc85effd549ae42318b37555a4c76ebc479b92a

commit 1bc85effd549ae42318b37555a4c76ebc479b92a
Author: Frederic Berat <fberat@redhat.com>
Date:   Tue Jun 20 20:18:52 2023 +0200

    sysdeps/{i386, x86_64}/mempcpy_chk.S: fix linknamespace for __mempcpy_chk
    
    On i386 and x86_64, for libc.a specifically, __mempcpy_chk calls
    mempcpy which leads POSIX routines to call non-POSIX mempcpy indirectly.
    
    This leads the linknamespace test to fail when glibc is built with
    __FORTIFY_SOURCE=3.
    
    Since calling mempcpy doesn't bring any benefit for libc.a, directly
    call __mempcpy instead.
    
    Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>

Diff:
---
 sysdeps/i386/mempcpy_chk.S   | 2 +-
 sysdeps/x86_64/mempcpy_chk.S | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sysdeps/i386/mempcpy_chk.S b/sysdeps/i386/mempcpy_chk.S
index 8b785bd9a5..1e9bf71bfb 100644
--- a/sysdeps/i386/mempcpy_chk.S
+++ b/sysdeps/i386/mempcpy_chk.S
@@ -28,6 +28,6 @@ ENTRY (__mempcpy_chk)
 	movl	12(%esp), %eax
 	cmpl	%eax, 16(%esp)
 	jb	__chk_fail
-	jmp	mempcpy
+	jmp	__mempcpy
 END (__mempcpy_chk)
 #endif
diff --git a/sysdeps/x86_64/mempcpy_chk.S b/sysdeps/x86_64/mempcpy_chk.S
index b1ddb02f78..b60ee4ff08 100644
--- a/sysdeps/x86_64/mempcpy_chk.S
+++ b/sysdeps/x86_64/mempcpy_chk.S
@@ -28,6 +28,6 @@
 ENTRY (__mempcpy_chk)
 	cmpq	%rdx, %rcx
 	jb	__chk_fail
-	jmp	mempcpy
+	jmp	__mempcpy
 END (__mempcpy_chk)
 #endif

                 reply	other threads:[~2023-06-22  4:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230622045331.77A893858D28@sourceware.org \
    --to=siddhesh@sourceware.org \
    --cc=glibc-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).