Projects
Factory:RISC-V:Base
glibc
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 7
View file
_service:tar_scm:glibc.spec
Changed
@@ -65,7 +65,7 @@ ############################################################################## Name: glibc Version: 2.36 -Release: 10 +Release: 13 Summary: The GNU libc libraries License: %{all_license} URL: http://www.gnu.org/software/glibc/ @@ -91,6 +91,8 @@ Patch5: Linux-Do-not-skip-d_ino-0-entries-in-readdir-readdir.patch Patch6: 0001-gconv-Use-64-bit-interfaces-in-gconv_parseconfdir-bu.patch Patch7: 0001-syslog-Remove-extra-whitespace-between-timestamp-and.patch +Patch8: Makerules-fix-MAKEFLAGS-assignment-for-upcoming-make.patch +Patch9: gmon-Fix-allocated-buffer-overflow-bug-29444.patch Patch9000: turn-default-value-of-x86_rep_stosb_threshold_form_2K_to_1M.patch Patch9001: locale-delete-no-hard-link-to-avoid-all_language-pac.patch @@ -107,6 +109,7 @@ Patch9012: malloc-use-__get_nprocs-replace-__get_nprocs_sched.patch Patch9013: x86-use-total-l3cache-for-non_temporal_threshold.patch Patch9014: strcmp-delete-align-for-loop_aligned.patch +Patch9015: add-pthread_cond_clockwait-GLIBC_2_28.patch Provides: ldconfig rtld(GNU_HASH) bundled(gnulib) @@ -1266,6 +1269,16 @@ %endif %changelog +* Thu Feb 23 2023 Qingqing Li <liqingqing3@huawei.com> - 2.36-13 +- gmon: Fix allocated buffer overflow (bug 29444) + +* Wed Feb 1 2023 Yang Yanchao <yangyanchao6@huawei.com> - 2.36-12 +- Since the pthread_cond_clockwait@GLIBC_2_28 is introduced in earlier + versions, this symbol is required to keep the previous items compatible. + +* Thu Jan 12 2023 Qingqing Li <liqingqing3@huawei.com> - 2.36-11 +- Makerules: fix MAKEFLAGS assignment for upcoming make-4.4 + * Sat Sep 24 2022 Xu Wu<wuxu.wu@huawei.com> - 2.36-10 - syslog: Fix large messages (BZ#29536) @@ -1299,7 +1312,7 @@ * Thu Jul 28 2022 Qingqing Li <liqingqing3@huawei.com> - 2.35-16 - optimize Obsoletes version -* Wed Jul 7 2022 Qingqing Li <liqingqing3@huawei.com> - 2.35-15 +* Thu Jul 7 2022 Qingqing Li <liqingqing3@huawei.com> - 2.35-15 - enable -werror by default * Tue Jul 5 2022 Yang Yanchao <yangyanchao6@huawei.com> - 2.35-14
View file
_service:tar_scm:Makerules-fix-MAKEFLAGS-assignment-for-upcoming-make.patch
Added
@@ -0,0 +1,114 @@ +From 2d7ed98add14f75041499ac189696c9bd3d757fe Mon Sep 17 00:00:00 2001 +From: Sergei Trofimovich <slyich@gmail.com> +Date: Tue, 13 Sep 2022 13:39:13 -0400 +Subject: PATCH Makerules: fix MAKEFLAGS assignment for upcoming make-4.4 + BZ# 29564 + +make-4.4 will add long flags to MAKEFLAGS variable: + + * WARNING: Backward-incompatibility! + Previously only simple (one-letter) options were added to the MAKEFLAGS + variable that was visible while parsing makefiles. Now, all options + are available in MAKEFLAGS. + +This causes locale builds to fail when long options are used: + + $ make --shuffle + ... + make -C localedata install-locales + make: invalid shuffle mode: '1662724426r' + +The change fixes it by passing eash option via whitespace and dashes. +That way option is appended to both single-word form and whitespace +separated form. + +While at it fixed --silent mode detection in $(MAKEFLAGS) by filtering +out --long-options. Otherwise options like --shuffle flag enable silent +mode unintentionally. $(silent-make) variable consolidates the checks. + +Resolves: BZ# 29564 + +CC: Paul Smith <psmith@gnu.org> +CC: Siddhesh Poyarekar <siddhesh@gotplt.org> +Signed-off-by: Sergei Trofimovich <slyich@gmail.com> +Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org> +--- + Makeconfig | 18 +++++++++++++++++- + Makerules | 4 ++-- + elf/rtld-Rules | 2 +- + 3 files changed, 20 insertions(+), 4 deletions(-) + +diff --git a/Makeconfig b/Makeconfig +index f8164a0025..842f49eb58 100644 +--- a/Makeconfig ++++ b/Makeconfig +@@ -43,6 +43,22 @@ else + $(error objdir must be defined by the build-directory Makefile) + endif + ++# Did we request 'make -s' run? "yes" or "no". ++# Starting from make-4.4 MAKEFLAGS now contains long ++# options like '--shuffle'. To detect presence of 's' ++# we pick first word with short options. Long options ++# are guaranteed to come after whitespace. We use '-' ++# prefix to always have a word before long options ++# even if no short options were passed. ++# Typical MAKEFLAGS values to watch for: ++# "rs --shuffle=42" (silent) ++# " --shuffle" (not silent) ++ifeq ($(findstring s, $(firstword -$(MAKEFLAGS))),) ++silent-make := no ++else ++silent-make := yes ++endif ++ + # Root of the sysdeps tree. + sysdep_dir := $(..)sysdeps + export sysdep_dir := $(sysdep_dir) +@@ -917,7 +933,7 @@ endif + # umpteen zillion filenames along with it (we use `...' instead) + # but we don't want this echoing done when the user has said + # he doesn't want to see commands echoed by using -s. +-ifneq "$(findstring s,$(MAKEFLAGS))" "" # if -s ++ifeq ($(silent-make),yes) # if -s + +cmdecho := echo >/dev/null + else # not -s + +cmdecho := echo +diff --git a/Makerules b/Makerules +index d1e139d03c..09c0cf8357 100644 +--- a/Makerules ++++ b/Makerules +@@ -794,7 +794,7 @@ endif + # Maximize efficiency by minimizing the number of rules. + .SUFFIXES: # Clear the suffix list. We don't use suffix rules. + # Don't define any builtin rules. +-MAKEFLAGS := $(MAKEFLAGS)r ++MAKEFLAGS := $(MAKEFLAGS) -r + + # Generic rule for making directories. + %/: +@@ -811,7 +811,7 @@ MAKEFLAGS := $(MAKEFLAGS)r + .PRECIOUS: $(foreach l,$(libtypes),$(patsubst %,$(common-objpfx)$l,c)) +  + # Use the verbose option of ar and tar when not running silently. +-ifeq "$(findstring s,$(MAKEFLAGS))" "" # if not -s ++ifeq ($(silent-make),no) # if not -s + verbose := v + else # -s + verbose := +diff --git a/elf/rtld-Rules b/elf/rtld-Rules +index ca00dd1fe2..3c5e273f2b 100644 +--- a/elf/rtld-Rules ++++ b/elf/rtld-Rules +@@ -52,7 +52,7 @@ $(objpfx)rtld-libc.a: $(foreach dir,$(rtld-subdirs),\ + mv -f $@T $@ + + # Use the verbose option of ar and tar when not running silently. +-ifeq "$(findstring s,$(MAKEFLAGS))" "" # if not -s ++ifeq ($(silent-make),no) # if not -s + verbose := v + else # -s + verbose := +-- +2.33.0 +
View file
_service:tar_scm:add-pthread_cond_clockwait-GLIBC_2_28.patch
Added
@@ -0,0 +1,66 @@ +From e6569a3c53c25916f5c04ccc3d6a467c57d4eab8 Mon Sep 17 00:00:00 2001 +From: Yang Yanchao <yangyanchao6@huawei.com> +Date: Thu, 19 Jan 2023 21:40:08 +0800 +Subject: PATCH add pthread_cond_clockwait@GLIBC_2_28 + +Since the pthread_cond_clockwait@GLIBC_2_28 is introduced in earlier +versions, this symbol is required to keep the previous items compatible. + +--- + nptl/Versions | 1 + + nptl/pthread_cond_wait.c | 4 ++++ + sysdeps/unix/sysv/linux/aarch64/libc.abilist | 1 + + sysdeps/unix/sysv/linux/x86_64/64/libc.abilist | 1 + + 5 files changed, 9 insertions(+) + +diff --git a/nptl/Versions b/nptl/Versions +index 3221de89..dc341f9d 100644 +--- a/nptl/Versions ++++ b/nptl/Versions +@@ -231,6 +231,7 @@ libc { + tss_delete; + tss_get; + tss_set; ++ pthread_cond_clockwait; + } + GLIBC_2.30 { + pthread_cond_clockwait; +diff --git a/nptl/pthread_cond_wait.c b/nptl/pthread_cond_wait.c +index dc8c511f..04eeff34 100644 +--- a/nptl/pthread_cond_wait.c ++++ b/nptl/pthread_cond_wait.c +@@ -709,3 +709,7 @@ versioned_symbol (libc, ___pthread_cond_clockwait, + compat_symbol (libpthread, ___pthread_cond_clockwait, + pthread_cond_clockwait, GLIBC_2_30); + #endif ++#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_28, GLIBC_2_34) ++compat_symbol (libpthread, ___pthread_cond_clockwait, ++ pthread_cond_clockwait, GLIBC_2_28); ++#endif +diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist +index a4262419..a0795a80 100644 +--- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist ++++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist +@@ -383,6 +383,7 @@ GLIBC_2.28 mtx_lock F + GLIBC_2.28 mtx_timedlock F + GLIBC_2.28 mtx_trylock F + GLIBC_2.28 mtx_unlock F ++GLIBC_2.28 pthread_cond_clockwait F + GLIBC_2.28 renameat2 F + GLIBC_2.28 statx F + GLIBC_2.28 thrd_create F +diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist +index 095e914b..0eaab342 100644 +--- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist ++++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist +@@ -2413,6 +2413,7 @@ GLIBC_2.28 mtx_lock F + GLIBC_2.28 mtx_timedlock F + GLIBC_2.28 mtx_trylock F + GLIBC_2.28 mtx_unlock F ++GLIBC_2.28 pthread_cond_clockwait F + GLIBC_2.28 renameat2 F + GLIBC_2.28 statx F + GLIBC_2.28 thrd_create F +-- +2.33.0 +
View file
_service:tar_scm:gmon-Fix-allocated-buffer-overflow-bug-29444.patch
Added
@@ -0,0 +1,79 @@ +From 801af9fafd4689337ebf27260aa115335a0cb2bc Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=D0=9B=D0=B5=D0=BE=D0=BD=D0=B8=D0=B4=20=D0=AE=D1=80=D1=8C?= + =?UTF-8?q?=D0=B5=D0=B2=20=28Leonid=20Yuriev=29?= <leo@yuriev.ru> +Date: Sat, 4 Feb 2023 14:41:38 +0300 +Subject: PATCH gmon: Fix allocated buffer overflow (bug 29444) +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The `__monstartup()` allocates a buffer used to store all the data +accumulated by the monitor. + +The size of this buffer depends on the size of the internal structures +used and the address range for which the monitor is activated, as well +as on the maximum density of call instructions and/or callable functions +that could be potentially on a segment of executable code. + +In particular a hash table of arcs is placed at the end of this buffer. +The size of this hash table is calculated in bytes as + p->fromssize = p->textsize / HASHFRACTION; + +but actually should be + p->fromssize = ROUNDUP(p->textsize / HASHFRACTION, sizeof(*p->froms)); + +This results in writing beyond the end of the allocated buffer when an +added arc corresponds to a call near from the end of the monitored +address range, since `_mcount()` check the incoming caller address for +monitored range but not the intermediate result hash-like index that +uses to write into the table. + +It should be noted that when the results are output to `gmon.out`, the +table is read to the last element calculated from the allocated size in +bytes, so the arcs stored outside the buffer boundary did not fall into +`gprof` for analysis. Thus this "feature" help me to found this bug +during working with https://sourceware.org/bugzilla/show_bug.cgi?id=29438 + +Just in case, I will explicitly note that the problem breaks the +`make test t=gmon/tst-gmon-dso` added for Bug 29438. +There, the arc of the `f3()` call disappears from the output, since in +the DSO case, the call to `f3` is located close to the end of the +monitored range. + +Signed-off-by: Леонид Юрьев (Leonid Yuriev) <leo@yuriev.ru> + +Another minor error seems a related typo in the calculation of +`kcountsize`, but since kcounts are smaller than froms, this is +actually to align the p->froms data. + +Co-authored-by: DJ Delorie <dj@redhat.com> +Reviewed-by: Carlos O'Donell <carlos@redhat.com> +--- + gmon/gmon.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/gmon/gmon.c b/gmon/gmon.c +index dee64803ad..bf76358d5b 100644 +--- a/gmon/gmon.c ++++ b/gmon/gmon.c +@@ -132,6 +132,8 @@ __monstartup (u_long lowpc, u_long highpc) + p->lowpc = ROUNDDOWN(lowpc, HISTFRACTION * sizeof(HISTCOUNTER)); + p->highpc = ROUNDUP(highpc, HISTFRACTION * sizeof(HISTCOUNTER)); + p->textsize = p->highpc - p->lowpc; ++ /* This looks like a typo, but it's here to align the p->froms ++ section. */ + p->kcountsize = ROUNDUP(p->textsize / HISTFRACTION, sizeof(*p->froms)); + p->hashfraction = HASHFRACTION; + p->log_hashfraction = -1; +@@ -142,7 +144,7 @@ __monstartup (u_long lowpc, u_long highpc) + instead of integer division. Precompute shift amount. */ + p->log_hashfraction = ffs(p->hashfraction * sizeof(*p->froms)) - 1; + } +- p->fromssize = p->textsize / HASHFRACTION; ++ p->fromssize = ROUNDUP(p->textsize / HASHFRACTION, sizeof(*p->froms)); + p->tolimit = p->textsize * ARCDENSITY / 100; + if (p->tolimit < MINARCS) + p->tolimit = MINARCS; +-- +2.33.0 +
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2