Sync with Fedora rawhide (glibc-2.33.9000-29.fc35)

rawhide commit: 0034c1747f

Resolves: #1958224
This commit is contained in:
Florian Weimer 2021-06-27 21:23:07 +02:00
parent a4c56122fa
commit fe2bb6712c
6 changed files with 287 additions and 8 deletions

View File

@ -0,0 +1,107 @@
Emergency patch from libc-alpha.
From: Siddhesh Poyarekar <siddhesh@sourceware.org>
Subject: [PATCH v2] iconvconfig: Fix multiple issues
To: libc-alpha@sourceware.org
Cc: schwab@linux-m68k.org, fweimer@redhat.com
Date: Fri, 25 Jun 2021 14:31:28 +0530
Message-Id: <20210625090128.316837-1-siddhesh@sourceware.org>
It was noticed on big-endian systems that msgfmt would fail with the
following error:
msgfmt: gconv_builtin.c:70: __gconv_get_builtin_trans: Assertion `cnt < sizeof (map) / sizeof (map[0])' failed.
Aborted (core dumped)
This is only seen on installed systems because it was due to a
corrupted gconv-modules.cache. iconvconfig had the following issues
(it was specifically freeing fulldir that caused this issue, but other
cleanups are also needed) that this patch fixes.
- Add prefix only if dir starts with '/'
- Use asprintf instead of mempcpy so that the directory string is NULL
terminated
- Make a copy of the directory reference in new_module so that fulldir
can be freed within the same scope in handle_dir.
---
iconv/Makefile | 2 +-
iconv/iconvconfig.c | 24 +++++++++---------------
2 files changed, 10 insertions(+), 16 deletions(-)
diff --git a/iconv/Makefile b/iconv/Makefile
index a9b267c851..07d77c9eca 100644
--- a/iconv/Makefile
+++ b/iconv/Makefile
@@ -33,7 +33,7 @@ vpath %.c ../locale/programs ../intl
iconv_prog-modules = iconv_charmap charmap charmap-dir linereader \
dummy-repertoire simple-hash xstrdup xmalloc \
record-status
-iconvconfig-modules = strtab xmalloc hash-string
+iconvconfig-modules = strtab xmalloc xasprintf xstrdup hash-string
extra-objs = $(iconv_prog-modules:=.o) $(iconvconfig-modules:=.o)
CFLAGS-iconv_prog.c += -I../locale/programs
CFLAGS-iconv_charmap.c += -I../locale/programs
diff --git a/iconv/iconvconfig.c b/iconv/iconvconfig.c
index e69334d71c..783b2bbdbb 100644
--- a/iconv/iconvconfig.c
+++ b/iconv/iconvconfig.c
@@ -250,6 +250,7 @@ static const char gconv_module_ext[] = MODULE_EXT;
#include <programs/xmalloc.h>
+#include <programs/xasprintf.h>
/* C string table handling. */
@@ -519,11 +520,12 @@ module_compare (const void *p1, const void *p2)
/* Create new module record. */
static void
new_module (const char *fromname, size_t fromlen, const char *toname,
- size_t tolen, const char *directory,
+ size_t tolen, const char *dir_in,
const char *filename, size_t filelen, int cost, size_t need_ext)
{
struct module *new_module;
- size_t dirlen = strlen (directory) + 1;
+ size_t dirlen = strlen (dir_in) + 1;
+ const char *directory = xstrdup (dir_in);
char *tmp;
void **inserted;
@@ -654,20 +656,10 @@ handle_dir (const char *dir)
size_t dirlen = strlen (dir);
bool found = false;
- /* Add the prefix before sending it off to the parser. */
- char *fulldir = xmalloc (prefix_len + dirlen + 2);
- char *cp = mempcpy (mempcpy (fulldir, prefix, prefix_len), dir, dirlen);
+ char *fulldir = xasprintf ("%s%s%s", dir[0] == '/' ? prefix : "",
+ dir, dir[dirlen - 1] != '/' ? "/" : "");
- if (dir[dirlen - 1] != '/')
- {
- *cp++ = '/';
- *cp = '\0';
- dirlen++;
- }
-
- found = gconv_parseconfdir (fulldir, dirlen + prefix_len);
-
- free (fulldir);
+ found = gconv_parseconfdir (fulldir, strlen (fulldir));
if (!found)
{
@@ -679,6 +671,8 @@ handle_dir (const char *dir)
"configuration files with names ending in .conf.");
}
+ free (fulldir);
+
return found ? 0 : 1;
}
--
2.31.1

View File

@ -11,16 +11,18 @@ Date: Wed Jun 9 14:12:46 2021 +0200
test ensures that the official names of libc.so, ld.so, and their
versioned names are recognized.
diff --git a/elf/Makefile b/elf/Makefile
index 5c47daee12505a47..1751f5ec6772eceb 100644
index 38d08e03b8979a81..62f7e8a22544ab9d 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -223,7 +223,7 @@ tests += restest1 preloadtest loadfail multiload origtest resolvfail \
@@ -223,7 +223,8 @@ tests += restest1 preloadtest loadfail multiload origtest resolvfail \
tst-single_threaded tst-single_threaded-pthread \
tst-tls-ie tst-tls-ie-dlmopen argv0test \
tst-glibc-hwcaps tst-glibc-hwcaps-prepend tst-glibc-hwcaps-mask \
- tst-tls20 tst-tls21 tst-dlmopen-dlerror
+ tst-tls20 tst-tls21 tst-dlmopen-dlerror tst-dl-is_dso
- tst-tls20 tst-tls21 tst-dlmopen-dlerror tst-dlmopen-gethostbyname
+ tst-tls20 tst-tls21 tst-dlmopen-dlerror tst-dlmopen-gethostbyname \
+ tst-dl-is_dso
# reldep9
tests-internal += loadtest unload unload2 circleload1 \
neededtest neededtest2 neededtest3 neededtest4 \

3
glibc.attr Normal file
View File

@ -0,0 +1,3 @@
%__glibc_requires %{_rpmconfigdir}/glibc.req
%__glibc_magic ELF
%__glibc_flags exeonly

42
glibc.req.in Normal file
View File

@ -0,0 +1,42 @@
#!/bin/bash
# Auto-generating dependencies for glibc development snapshots.
#
# A glibc development snapshot (say version 2.33.9000) may define
# symbols in its under-development symbol version (GLIBC_2.34). RPM
# automatically derives RPM dependencies such as
# libc.so.6(GLIBC_2.34)(64bit) from that. While the GLIBC_2.34
# version is under development, these dependencies may be inaccurate
# and could be satisfied by glibc RPM package versions that lack the
# symbols because they were created from an earlier development
# snapshot that had some other GLIBC_2.34 symbols. Therefore, if the
# latest, under-development ELF symbol version is detected, this
# dependency generator adds an explicit RPM dependencies on the glibc
# packaging version against which an RPM package is built.
#
# This script runs for the glibc build itself. In this case, it may
# produce a >= dependency on the build-time glibc, but there will also
# be an (potentially indirect) = dependency, which takes precedence.
set -e
set -o pipefail
searching=true
# Pre-filter using eu-elfclassify, to skip kernel modules.
eu-elfclassify --loadable --file --stdin --print | while read path; do
# Assume that all dynamically linked objects depend on glibc in
# some way.
if $searching; then
# Undefined symbols within latest, under-development
# (changing) symbol versions trigger the versioned RPM
# dependency. Do not use "egrep -q" to keep reading from the
# pipe, avoiding a spurious EPIPE error in eu-readelf.
if eu-readelf -s "$path" \
| egrep '\sUNDEF\s.*@''@SYMVER@(\s|$)' >/dev/null
then
echo 'glibc >= @VERSION@-@RELEASE@'
# Stop searching after the first match, but keep reading from
# the pipe.
searching=false
fi
fi
done

View File

@ -1,4 +1,4 @@
%define glibcsrcdir glibc-2.33.9000-728-gaa9a7f6296
%define glibcsrcdir glibc-2.33.9000-805-g2c16cb88a6
%define glibcversion 2.33.9000
# Pre-release tarballs are pulled in from git using a command that is
# effectively:
@ -8,8 +8,22 @@
# gzip -9 $(git describe --match 'glibc-*').tar
#
# glibc_release_url is only defined when we have a release tarball.
# Conversly, glibc_autorequires is set for development snapshots, where
# dependencies based on symbol versions are inaccurate.
%{lua: if string.match(rpm.expand("%glibcsrcdir"), "^glibc%-[0-9.]+$") then
rpm.define("glibc_release_url https://ftp.gnu.org/gnu/glibc/") end}
rpm.define("glibc_release_url https://ftp.gnu.org/gnu/glibc/")
end
local major, minor = string.match(rpm.expand("%glibcversion"),
"^([0-9]+)%.([0-9]+)%.9000$")
if major and minor then
rpm.define("glibc_autorequires 1")
-- The minor version in a .9000 development version lags the actual
-- symbol version by one.
local symver = "GLIBC_" .. major .. "." .. (minor + 1)
rpm.define("glibc_autorequires_symver " .. symver)
else
rpm.define("glibc_autorequires 0")
end}
##############################################################################
# We support the following options:
# --with/--without,
@ -97,7 +111,7 @@
Summary: The GNU libc libraries
Name: glibc
Version: %{glibcversion}
Release: 24%{?dist}
Release: 29%{?dist}
# In general, GPLv2+ is used by programs, LGPLv2+ is used for
# libraries.
@ -131,6 +145,8 @@ Source0: %{?glibc_release_url}%{glibcsrcdir}.tar.xz
Source1: nscd.conf
Source2: bench.mk
Source3: glibc-bench-compare
Source4: glibc.req.in
Source5: glibc.attr
Source10: wrap-find-debuginfo.sh
Source11: parse-SUPPORTED.py
# Include in the source RPM for reference.
@ -179,6 +195,7 @@ Patch35: glibc-nosymlink-2.patch
Patch36: glibc-nosymlink-3.patch
Patch37: glibc-nosymlink-4.patch
Patch38: glibc-libthread_db-dynsym.patch
Patch39: glibc-iconvconfig-corruption.patch
##############################################################################
# Continued list of core "glibc" package information:
@ -1659,6 +1676,16 @@ sed -i -e '\,libmemusage.so,d' \
-e '\,/libnss_[a-z]*\.so$,d' \
devel.filelist
%if %{glibc_autorequires}
mkdir -p %{glibc_sysroot}/%{_rpmconfigdir} %{glibc_sysroot}/%{_fileattrsdir}
sed < %{SOURCE4} \
-e s/@VERSION@/%{version}/ \
-e s/@RELEASE@/%{release}/ \
-e s/@SYMVER@/%{glibc_autorequires_symver}/ \
> %{glibc_sysroot}/%{_rpmconfigdir}/glibc.req
cp %{SOURCE5} %{glibc_sysroot}/%{_fileattrsdir}/glibc.attr
%endif
###############################################################################
# glibc-doc
###############################################################################
@ -2132,6 +2159,10 @@ fi
%{_prefix}/share/i18n/charmaps/*
%files -f devel.filelist devel
%if %{glibc_autorequires}
%attr(0755,root,root) %{_rpmconfigdir}/glibc.req
%{_fileattrsdir}/glibc.attr
%endif
%if %{with docs}
%files -f doc.filelist doc
@ -2182,6 +2213,100 @@ fi
%files -f compat-libpthread-nonshared.filelist -n compat-libpthread-nonshared
%changelog
* Sun Jun 27 2021 Florian Weimer <fweimer@redhat.com> - 2.33.9000-29
- Apply emergency patch to fix iconvconfig corruption
* Sun Jun 27 2021 Florian Weimer <fweimer@redhat.com> - 2.33.9000-28
- Adjust glibc.req so that egrep does not cause eu-readelf to fail
* Sun Jun 27 2021 Florian Weimer <fweimer@redhat.com> - 2.33.9000-27
- Drop glibc-revert-dtv-gap-reuse.patch, applied upstream.
- Auto-sync with upstream branch master,
commit 2c16cb88a6e5ace0fb7cedca86860ea7bde522a7:
- Linux: Move timer helper routines from librt to libc
- Linux: Move mq_unlink from librt to libc
- Linux: Move mq_send, mq_timedsend, __mq_timedsend_time64 to libc
- Linux: Move mq_receive, mq_timedreceive, __mq_timedreceive_time64 to libc
- Linux: Move mq_open, __mq_open_2 from librt to libc
- Linux: Move mq_notify from librt to libc
- Linux: Move mq_getattr from librt to libc
- Linux: Move mq_setattr from librt to libc
- Linux: Move mq_close from librt to libc
- Linux: Move lio_listio, lio_listio64 from librt to libc
- rt: Rework lio_listio implementation
- Linux: Move aio_write, aio_write64 into libc
- Linux: Move aio_suspend, aio_suspend64, __aio_suspend_time64 to libc
- Linux: Move aio_return, aio_return64 into libc
- Linux: Move aio_read, aio_read64 into libc
- Linux: Move aio_fsync, aio_fsync64 into libc
- Linux: Move aio_error, aio_error64 into libc
- Linux: Move aio_cancel, aio_cancel64 into libc
- Linux: Move aio_init from librt into libc
- support: Fix xclone build failures on ia64 and hppa
- elf: Disable most of TLS modid gaps processing [BZ #27135]
- elf: Fix glibc-hwcaps priorities with cache flags mismatches [BZ #27046]
- * NEWS: Clarify _TIME_BITS change.
- x86: Remove unnecessary overflow check from wcsnlen-sse4_1.S
- String: Add three more overflow tests cases to test-strnlen.c
- Consolidate pthread_atfork
- posix: Do not clobber errno by atfork handlers
- posix: Consolidate fork implementation
- support: Add xclone
- x86: Fix tst-cpu-features-cpuinfo on Ryzen 9 (BZ #27873)
- x86: Copy IBT and SHSTK usable only if CET is enabled
- x86: Fix overflow bug in wcsnlen-sse4_1 and wcsnlen-avx2 [BZ #27974]
- x86: Fix overflow bug with wmemchr-sse2 and wmemchr-avx2 [BZ #27974]
- String: Add overflow tests for strnlen, memchr, and strncat [BZ #27974]
- x86-64: Add wcslen optimize for sse4.1
- x86-64: Move strlen.S to multiarch/strlen-vec.S
- hurd: Fix build after 52a5fe70a2
- nptl: Use SA_RESTART for SIGCANCEL handler
- doc: _TIME_BITS defaults may change
- More mcheck -> malloc-check refactoring
- Add NEWS item for gconv-modules.d change
- Handle DT_UNKNOWN in gconv-modules.d
- iconvconfig: Use common gconv module parsing function
- gconv_conf: Split out configuration file processing
- gconv_conf: Remove unused variables
- iconv: Remove alloca use in gconv-modules configuration parsing
- Remove unsused symbols from nptl/Versions
- linux: Only use 64-bit syscall if required for clock_nanosleep
- linux: Only use 64-bit syscall if required for internal futex
- linux: Only use 64-bit syscall if required for utimensat family
- linux: Only use 64-bit syscall if required for sigtimedwait
- linux: Only use 64-bit syscall if required for mq_timedsend
- linux: Only use 64-bit syscall if required for mq_timedreceive
- linux: Only use 64-bit syscall if required for timerfd_settime
- linux: Only use 64-bit syscall if required for semtimedop
- linux: timerfd_gettime minor cleanup
- linux: Remove time64-support
- linux: Remove supports_time64 () from clock_gettime
- linux: Remove supports_time64 () from clock_getres
- linux: Only use 64-bit syscall if required for select
- linux: Only use 64-bit syscall if required for pselect
- linux: Only use 64-bit syscall if required for ppoll
- support: Add support_create_timer
- Use 64 bit time_t stat internally
- malloc: Drop __malloc_initialized from Versions
- tst-mcheck: Rename to tst-malloc-check
- Add hidden prototypes for fsync, fdatasync
- nptl: Move pthreadP.h into sysdeps directory
- rt: Move generic implementation from sysdeps/pthread to rt
- rt: Move shm_unlink into libc
- rt: Move shm_open into libc
- rt: Replace generic stub of shm_unlink with the posix version
- rt: Replace generic stub of shm_open with the posix version
- Fix librt-routines-var issues for !PTHREAD_IN_LIBC
- rt: Lexicographically sort Versions file; librt-routines in Makefile
- elf: Use _dl_catch_error from base namespace in dl-libc.c [BZ #27646]
- Makeconfig: Fix time64-compat.mk target
* Sun Jun 27 2021 Florian Weimer <fweimer@redhat.com> - 2.33.9000-26
- Add automatic requires if building against glibc development snapshots
* Thu Jun 24 2021 Carlos O'Donell <carlos@redhat.com> - 2.33.9000-25
- Fix thread local storage corruption (#1974970)
* Tue Jun 22 2021 Siddhesh Poyarekar <siddhesh@redhat.com> - 2.33.9000-24
- Strengthen dependency on glibc-gconv-extra.

View File

@ -1 +1 @@
SHA512 (glibc-2.33.9000-728-gaa9a7f6296.tar.xz) = 99af420fe04976754515154aa9b60769624b431bdfeedcdcea62b1357fc6ef0f1f5f84bac203eb5af142d5eff0034fdc25e55b4fe644aec8b3d283f0e0e14bd8
SHA512 (glibc-2.33.9000-805-g2c16cb88a6.tar.xz) = 50431e03ec0e32b2d6c9aed85cc219536d9a896d3c692dc162ea4435a7a5673972fd04f766968f05b264b52eb2306c704eebed74a4916578cf95a96ce92a4d5f