ppc64le: scv ABI error handling fails to check IS_ERR_VALUE (#1963901)

Resolves: #1963901
This commit is contained in:
Florian Weimer 2021-05-25 17:50:21 +02:00
parent 4a978d6156
commit 307aea32b4
2 changed files with 39 additions and 1 deletions

View File

@ -0,0 +1,32 @@
commit 0ef0e6de7fdfa18328b09ba2afb4f0112d4bdab4
Author: Nicholas Piggin <npiggin@gmail.com>
Date: Thu May 20 11:00:36 2021 -0300
powerpc: Fix handling of scv return error codes [BZ #27892]
When using scv for templated ASM syscalls, current code interprets any
negative return value as error, but the only valid error codes are in
the range -4095..-1 according to the ABI.
This commit also fixes 'signal.gen.test' strace test, where the issue
was first identified.
Reviewed-by: Matheus Castanho <msc@linux.ibm.com>
(cherry picked from commit 7de36744ee1325f35d3fe0ca079dd33c40b12267)
diff --git a/sysdeps/powerpc/powerpc64/sysdep.h b/sysdeps/powerpc/powerpc64/sysdep.h
index c57bb1c05d02f663..1ea4c3b917295168 100644
--- a/sysdeps/powerpc/powerpc64/sysdep.h
+++ b/sysdeps/powerpc/powerpc64/sysdep.h
@@ -398,8 +398,9 @@ LT_LABELSUFFIX(name,_name_end): ; \
#endif
#define RET_SCV \
- cmpdi r3,0; \
- bgelr+; \
+ li r9,-4095; \
+ cmpld r3,r9; \
+ bltlr+; \
neg r3,r3;
#define RET_SC \

View File

@ -89,7 +89,7 @@
Summary: The GNU libc libraries
Name: glibc
Version: %{glibcversion}
Release: 13%{?dist}
Release: 14%{?dist}
# In general, GPLv2+ is used by programs, LGPLv2+ is used for
# libraries.
@ -206,6 +206,7 @@ Patch71: glibc-upstream-2.33-40.patch
Patch72: glibc-cpu-check-1.patch
Patch73: glibc-cpu-check-2.patch
Patch74: glibc-cpu-check-3.patch
Patch75: glibc-upstream-2.33-41.patch
##############################################################################
# Continued list of core "glibc" package information:
@ -2160,6 +2161,11 @@ fi
%files -f compat-libpthread-nonshared.filelist -n compat-libpthread-nonshared
%changelog
* Tue May 25 2021 Florian Weimer <fweimer@redhat.com> - 2.33-14
- Import commit 0ef0e6de7fdfa18328b09ba2afb4f0112d4bdab4 from the
glibc 2.33 branch:
- ppc64le: scv ABI error handling fails to check IS_ERR_VALUE (#1963901)
* Fri May 21 2021 Florian Weimer <fweimer@redhat.com> - 2.33-13
- Switch back to a unified glibc-headers package (#1940686)