!121 sysnc from 2003ltssp1, fix bug 26971 and 26853

From: @liqingqing_1229
Reviewed-by: @wswsamao
Signed-off-by: @wswsamao
This commit is contained in:
openeuler-ci-bot 2021-02-23 09:16:26 +08:00 committed by Gitee
commit 6b8fb4b63f
3 changed files with 77 additions and 1 deletions

View File

@ -0,0 +1,27 @@
From d2d714b9fc02e4710d6dc769d8ec2c9dab0eb69a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Maximilian=20Kr=C3=BCger?= <max@maxfragg.de>
Date: Wed, 11 Nov 2020 11:21:30 +0100
Subject: [PATCH] Use O_CLOEXEC in sysconf [BZ #26791]
If sysconf is used in multithreaded processes, various filedescriptors
may leak due to missing O_CLOEXEC. This commit adds the flag.
---
sysdeps/unix/sysv/linux/sysconf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sysdeps/unix/sysv/linux/sysconf.c b/sysdeps/unix/sysv/linux/sysconf.c
index 7958a74164..9c5a4cb1a4 100644
--- a/sysdeps/unix/sysv/linux/sysconf.c
+++ b/sysdeps/unix/sysv/linux/sysconf.c
@@ -81,7 +81,7 @@ __sysconf (int name)
if (procfname != NULL)
{
- int fd = __open_nocancel (procfname, O_RDONLY);
+ int fd = __open_nocancel (procfname, O_RDONLY | O_CLOEXEC);
if (fd != -1)
{
/* This is more than enough, the file contains a single integer. */
--
2.19.1

View File

@ -0,0 +1,41 @@
From 5edf3d9fd6efe06fda37b2a460e60690a90457a4 Mon Sep 17 00:00:00 2001
From: Florian Weimer <fweimer@redhat.com>
Date: Mon, 9 Nov 2020 11:31:04 +0100
Subject: [PATCH] aarch64: Add unwind information to _start (bug 26853)
This adds CFI directives which communicate that the stack ends
with this function.
Fixes bug 26853.
---
sysdeps/aarch64/start.S | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/sysdeps/aarch64/start.S b/sysdeps/aarch64/start.S
index bad000f5..5360689c 100644
--- a/sysdeps/aarch64/start.S
+++ b/sysdeps/aarch64/start.S
@@ -43,10 +43,9 @@
*/
.text
- .globl _start
- .type _start,#function
-_start:
+ENTRY(_start)
/* Create an initial frame with 0 LR and FP */
+ cfi_undefined(x30)
mov x29, #0
mov x30, #0
@@ -102,6 +101,7 @@ _start:
__wrap_main:
b main
#endif
+END(_start)
/* Define a symbol for the first piece of initialized data. */
.data
--
2.23.0

View File

@ -59,7 +59,7 @@
##############################################################################
Name: glibc
Version: 2.28
Release: 50
Release: 51
Summary: The GNU libc libraries
License: %{all_license}
URL: http://www.gnu.org/software/glibc/
@ -105,6 +105,8 @@ Patch28: backport-aarch64-fix-stack-missing-after-sp-is-updated.patch
Patch29: backport-aarch64-push-the-set-of-rules-before-falling-into-sl.patch
Patch30: backport-Fix-buffer-overrun-in-EUC-KR-conversion-module-bz-24.patch
Patch31: backport-addmntent-Remove-unbounded-alloca-usage-from-getmnte.patch
Patch32: backport-Use-O_CLOEXEC-in-sysconf-BZ-26791.patch
Patch33: backport-aarch64-Add-unwind-information-to-_start-bug-26853.patch
Provides: ldconfig rtld(GNU_HASH) bundled(gnulib)
@ -1100,6 +1102,12 @@ fi
%doc hesiod/README.hesiod
%changelog
* Thu Jan 7 2021 Qingqing Li<liqingqing3@huawei.com> - 2.28-51
- Fix bug 26791: Use O_CLOEXEC in sysconf
bugzilla link: https://sourceware.org/bugzilla/show_bug.cgi?id=26791
- Fix bug 26853: aarch64: Add unwind information to _start
bugzilla link: https://sourceware.org/bugzilla/show_bug.cgi?id=26853
* Wed Jan 6 2021 Wang Shuo<wangshuo_1994@foxmail.com> - 2.28-50
- Fix stack missing in _dl_tlsdesc_dynamic
Fix buffer overrun in EUC-KR conversion module (bz #24973)