public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Szabolcs Nagy <nsz@sourceware.org>
To: glibc-cvs@sourceware.org
Subject: [glibc/arm/morello/main] alpha: Fix generic brk system call emulation in __brk_call (bug 29490)
Date: Wed, 26 Oct 2022 15:04:52 +0000 (GMT)	[thread overview]
Message-ID: <20221026150453.A976B385D0EC@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=8b139cd4f1074ae0d95d9bff60db283a1ed72734

commit 8b139cd4f1074ae0d95d9bff60db283a1ed72734
Author: Florian Weimer <fweimer@redhat.com>
Date:   Mon Aug 22 11:04:47 2022 +0200

    alpha: Fix generic brk system call emulation in __brk_call (bug 29490)
    
    The kernel special-cases the zero argument for alpha brk, and we can
    use that to restore the generic Linux error handling behavior.
    
    Fixes commit b57ab258c1140bc45464b4b9908713e3e0ee35aa ("Linux:
    Introduce __brk_call for invoking the brk system call").
    
    (cherry picked from commit e7ad26ee3cb74e61d0637c888f24dd478d77af58)

Diff:
---
 NEWS                                     | 1 +
 sysdeps/unix/sysv/linux/alpha/brk_call.h | 7 +++----
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/NEWS b/NEWS
index f8fb8db510..becab3ade9 100644
--- a/NEWS
+++ b/NEWS
@@ -11,6 +11,7 @@ The following bugs are resolved with this release:
 
   [29446] _dlopen now ignores dl_caller argument in static mode
   [29485] Linux: Terminate subprocess on late failure in tst-pidfd
+  [29490] alpha: New __brk_call implementation is broken
 
 \f
 Version 2.36
diff --git a/sysdeps/unix/sysv/linux/alpha/brk_call.h b/sysdeps/unix/sysv/linux/alpha/brk_call.h
index b8088cf13f..0b851b6c86 100644
--- a/sysdeps/unix/sysv/linux/alpha/brk_call.h
+++ b/sysdeps/unix/sysv/linux/alpha/brk_call.h
@@ -21,8 +21,7 @@ __brk_call (void *addr)
 {
   unsigned long int result = INTERNAL_SYSCALL_CALL (brk, addr);
   if (result == -ENOMEM)
-    /* Mimic the default error reporting behavior.  */
-    return addr;
-  else
-    return (void *) result;
+    /* Mimic the generic error reporting behavior.  */
+    result = INTERNAL_SYSCALL_CALL (brk, 0);
+  return (void *) result;
 }

                 reply	other threads:[~2022-10-26 15:04 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=20221026150453.A976B385D0EC@sourceware.org \
    --to=nsz@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).