This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch release/2.24/master updated. glibc-2.24-88-g17d5d67
- From: hjl at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 19 Jan 2018 17:52:42 -0000
- Subject: GNU C Library master sources branch release/2.24/master updated. glibc-2.24-88-g17d5d67
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, release/2.24/master has been updated
via 17d5d67f4f0350bdcfb5bf1a31cef2e14dabf7de (commit)
from f24c345bf5486cc8d659f7a17463adcae402ec8e (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=17d5d67f4f0350bdcfb5bf1a31cef2e14dabf7de
commit 17d5d67f4f0350bdcfb5bf1a31cef2e14dabf7de
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Fri Jan 19 09:51:58 2018 -0800
x86-64: Properly align La_x86_64_retval to VEC_SIZE [BZ #22715]
_dl_runtime_profile calls _dl_call_pltexit, passing a pointer to
La_x86_64_retval which is allocated on stack. The lrv_vector0
field in La_x86_64_retval must be aligned to size of vector register.
When allocating stack space for La_x86_64_retval, we need to make sure
that the address of La_x86_64_retval + RV_VECTOR0_OFFSET is aligned to
VEC_SIZE. This patch checks the alignment of the lrv_vector0 field
and pads the stack space if needed.
Tested with x32 and x86-64 on SSE4, AVX and AVX512 machines. It fixed
FAIL: elf/tst-audit10
FAIL: elf/tst-audit4
FAIL: elf/tst-audit5
FAIL: elf/tst-audit6
FAIL: elf/tst-audit7
on x32 AVX512 machine.
(cherry picked from commit 207a72e2988c6d6343f50fe0128eb4fc4edfdd15)
[BZ #22715]
* sysdeps/x86_64/dl-trampoline.h (_dl_runtime_profile): Properly
align La_x86_64_retval to VEC_SIZE.
diff --git a/ChangeLog b/ChangeLog
index 723b363..33f5758 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2018-01-19 H.J. Lu <hongjiu.lu@intel.com>
+
+ [BZ #22715]
+ * sysdeps/x86_64/dl-trampoline.h (_dl_runtime_profile): Properly
+ align La_x86_64_retval to VEC_SIZE.
+
2017-12-30 Aurelien Jarno <aurelien@aurel32.net>
Dmitry V. Levin <ldv@altlinux.org>
diff --git a/NEWS b/NEWS
index c2de2df..d11dfe1 100644
--- a/NEWS
+++ b/NEWS
@@ -60,6 +60,7 @@ The following bugs are resolved with this release:
[21609] x86-64: Align the stack in __tls_get_addr
[21624] Unsafe alloca allows local attackers to alias stack and heap (CVE-2017-1000366)
[21654] nss: Fix invalid cast in group merging
+ [22715] x86-64: Properly align La_x86_64_retval to VEC_SIZE
Version 2.24
diff --git a/sysdeps/x86_64/dl-trampoline.h b/sysdeps/x86_64/dl-trampoline.h
index b9c2f17..60c8a59 100644
--- a/sysdeps/x86_64/dl-trampoline.h
+++ b/sysdeps/x86_64/dl-trampoline.h
@@ -440,8 +440,16 @@ _dl_runtime_profile:
# ifdef RESTORE_AVX
/* sizeof(La_x86_64_retval). Need extra space for 2 SSE
registers to detect if xmm0/xmm1 registers are changed
- by audit module. */
- sub $(LRV_SIZE + XMM_SIZE*2), %RSP_LP
+ by audit module. Since rsp is aligned to VEC_SIZE, we
+ need to make sure that the address of La_x86_64_retval +
+ LRV_VECTOR0_OFFSET is aligned to VEC_SIZE. */
+# define LRV_SPACE (LRV_SIZE + XMM_SIZE*2)
+# define LRV_MISALIGNED ((LRV_SIZE + LRV_VECTOR0_OFFSET) & (VEC_SIZE - 1))
+# if LRV_MISALIGNED == 0
+ sub $LRV_SPACE, %RSP_LP
+# else
+ sub $(LRV_SPACE + VEC_SIZE - LRV_MISALIGNED), %RSP_LP
+# endif
# else
sub $LRV_SIZE, %RSP_LP # sizeof(La_x86_64_retval)
# endif
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 6 ++++++
NEWS | 1 +
sysdeps/x86_64/dl-trampoline.h | 12 ++++++++++--
3 files changed, 17 insertions(+), 2 deletions(-)
hooks/post-receive
--
GNU C Library master sources