Slava Barinov [Mon, 13 Apr 2020 11:06:19 +0000 (14:06 +0300)]
packaging: Support 32bit build for armv8-a CPU
Change-Id: I8e10854e04c31f546c4391efb997334804049b71
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
Dongkyun Son [Thu, 13 Feb 2020 06:57:37 +0000 (15:57 +0900)]
Revert "packaging: remove '-g' option to ix86's BuildFlags."
This reverts commit
56e1ccac650144a76d7a9c2e6016a01d2227d2ca.
Change-Id: If76115f26ad39342e1d8f3e42f8b5a6de87facda
Dongkyun Son [Tue, 28 Nov 2017 19:37:11 +0000 (04:37 +0900)]
packaging: add support option for -fstack-protector-strong
Change-Id: Ifabf235b9a4720aefb31ea52ec44d34000257d62
Signed-off-by: Dongkyun Son <dongkyun.s@samsung.com>
Slava Barinov [Wed, 5 Feb 2020 11:20:41 +0000 (14:20 +0300)]
packaging: Turning on PIE compilation by default
This makes all glibc internal tools (like getent) pie.
Change-Id: I134ec4c1d858397597d51411ed0073cb7330dc74
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
Dongkyun Son [Fri, 31 Jan 2020 05:23:29 +0000 (14:23 +0900)]
packaging: remove '-g' option to ix86's BuildFlags.
This is temporary commit for application build check with previous
toolchain's ld.
/home/swc/tizen-studio/tools/i586-linux-gnueabi-gcc-6.2/bin/../lib/gcc/i586-tizen-linux-gnueabi/6.2.1/../../../../i586-tizen-linux-gnueabi/bin/ld: /home/swc/tizen-studio/tools/smart-build-interface/../../platforms/tizen-6.0/mobile/rootstraps/mobile-6.0-emulator.core.public.20200129_1/usr/lib/crti.o: unable to initialize decompress status for section .debug_line
/home/swc/tizen-studio/tools/i586-linux-gnueabi-gcc-6.2/bin/../lib/gcc/i586-tizen-linux-gnueabi/6.2.1/../../../../i586-tizen-linux-gnueabi/bin/ld: /home/swc/tizen-studio/tools/smart-build-interface/../../platforms/tizen-6.0/mobile/rootstraps/mobile-6.0-emulator.core.public.20200129_1/usr/lib/crti.o: unable to initialize decompress status for section .debug_line
/home/swc/tizen-studio/tools/i586-linux-gnueabi-gcc-6.2/bin/../lib/gcc/i586-tizen-linux-gnueabi/6.2.1/../../../../i586-tizen-linux-gnueabi/bin/ld: /home/swc/tizen-studio/tools/smart-build-interface/../../platforms/tizen-6.0/mobile/rootstraps/mobile-6.0-emulator.core.public.20200129_1/usr/lib/crti.o: unable to initialize decompress status for section .debug_line
/home/swc/tizen-studio/tools/i586-linux-gnueabi-gcc-6.2/bin/../lib/gcc/i586-tizen-linux-gnueabi/6.2.1/../../../../i586-tizen-linux-gnueabi/bin/ld: /home/swc/tizen-studio/tools/smart-build-interface/../../platforms/tizen-6.0/mobile/rootstraps/mobile-6.0-emulator.core.public.20200129_1/usr/lib/crti.o: unable to initialize decompress status for section .debug_line
/home/swc/tizen-studio/tools/smart-build-interface/../../platforms/tizen-6.0/mobile/rootstraps/mobile-6.0-emulator.core.public.20200129_1/usr/lib/crti.o: file not recognized: File format not recognized
Related bug in assembler(gas) in binutils 2.31.1 and older:
Fixed binutils 2.32: https://sourceware.org/PR23919 .
Change-Id: Ib5c13e5474d490cb106b2d48608090857913c656
Signed-off-by: Dongkyun Son <dongkyun.s@samsung.com>
Dongkyun Son [Mon, 3 Feb 2020 05:24:38 +0000 (14:24 +0900)]
Revert "REMOVE ME: turn off crti/crtn debug section"
This reverts commit
b2b31d0007b81bac969f02385c142f4ae4f22ca9.
Change-Id: I9aa925227d8283f9c063442819dbe773eecc3c7a
Slava Barinov [Fri, 31 Jan 2020 06:54:10 +0000 (09:54 +0300)]
REMOVE ME: turn off crti/crtn debug section
Change-Id: Id3c7539d9cbc4316c496c091c56d4337c4d1027d
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
Slava Barinov [Mon, 13 Jan 2020 07:30:19 +0000 (10:30 +0300)]
Remove file offset flags from Glibc build
Glibc has to be built without these defines since it must have both 32bit and
64bit implementations
Change-Id: I1f08b70ab18447d842861e40d45c3a107f1bf206
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
Mikhail Kashkarov [Thu, 5 Dec 2019 18:46:54 +0000 (21:46 +0300)]
Build glibc itself with default offset bits
Signed-off-by: Mikhail Kashkarov <m.kashkarov@partner.samsung.com>
Mikhail Kashkarov [Fri, 20 Sep 2019 15:54:52 +0000 (18:54 +0300)]
Add rpm with testresults
Define "run_tests" or "glibc_run_tests" to enable it.
Change-Id: I14376885661f99efe001d3b86e57d5370475559e
Mikhail Kashkarov [Thu, 28 Nov 2019 16:01:23 +0000 (19:01 +0300)]
[Tizen 6.0] Release 2.30 version
Dongkyun Son [Wed, 10 Apr 2019 08:28:48 +0000 (17:28 +0900)]
Smack: add acess label to ldconfig to prevent privilege escalation
Change-Id: I5df0c2fa2c868dee6d3ee38ce8a4d53ce038efe8
Signed-off-by: Dongkyun Son <dongkyun.s@samsung.com>
Dongkyun Son [Wed, 12 Sep 2018 08:42:17 +0000 (17:42 +0900)]
packaging: add --disable-experimental-malloc
Switch off USE_TCACHE to keep the idle memory usage.
Change-Id: I97a31e904bdcb6600975a04333478cac899ab668
Signed-off-by: Dongkyun Son <dongkyun.s@samsung.com>
Karol Lewandowski [Fri, 31 Aug 2018 14:14:30 +0000 (16:14 +0200)]
tizen: Add optfiles nss module
Add optfiles module that can search passwd and group (incl. shadow)
databases in tizen-specific /opt/etc/ directory.
By default passwd & shadow databases are enabled. Group membership
will be granted by security-manager.
Change-Id: Id0cc4f86c9ddd06f2a4b1032b51451fab74a9d3a
Mikhail Kashkarov [Fri, 13 Jul 2018 17:44:40 +0000 (20:44 +0300)]
Repair glibc make check with -Wformat options enabled.
With -Wformat options enabled there are test fails:
cc1: error: -Wformat-security ignored without -Wformat [-Werror=format-security]
cc1: all warnings being treated as errors
../o-iterator.mk:9: recipe for target
'/home/abuild/rpmbuild/BUILD/glibc-2.24/cc-base/time/test_time.o' failed
As some targets disables -Wformat explicitly:
(time/Makefile):
# Don't warn about Y2k problem in strftime format string.
CFLAGS-test_time.c = -Wno-format
Change-Id: Ic0f8b6bb07ea7875a75b994584ac10cec6515827
Denis Khalikov [Fri, 8 Sep 2017 14:38:06 +0000 (17:38 +0300)]
[ASan] Enable build with ASan.
This patch enables ASan instrumentation for glibc.
1. Modifies rltd to support calling init for libasan.so
before libc.so. Also changes don't brake backward
compatibility against libpthread.so, because rtld will add
libpthread.so as a first library to initlist.
2. Changes the type of symbol __sched_cpucount from IFUNC
to FUNC, to avoid segfault at the relocation stage.
IFUCN is a spectial type of symbol which allows to call
resolver at the relocation stage (symbol binding),
so resolver instrumented with ASan will cause a segfault.
Change-Id: I99b6e230605801123e3e132f9934c75fae4e6cfa
Jaehun Jeong [Thu, 24 Aug 2017 00:45:04 +0000 (09:45 +0900)]
packaging: Apply ASLR
For enhance tizen security, ASLR(Address space layout randomization) is default after tizen 4.0.
All executable of glibc should be built with '-pie' option.
ldconfig and glibc_post_upgrade linked statically with all libraries
are not built with '-pie' due to conflict with '-static' link option.
TC result of all submodules have consistency between before and after
this patch except for elf. because it is releated with prelink function.
so the elf TC is always fail under ASLR.
Change-Id: I8cbdf31914e0170d7d28385d830fd45a7a30d75d
Signed-off-by: Jaehun Jeong <jh4u.jeong@samsung.com>
Slava Barinov [Fri, 28 Jul 2017 15:13:02 +0000 (18:13 +0300)]
packaging: Switch off ASan
Change-Id: I38e228d0389905dac11a300295cfc32df0cfe112
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
Dongkyun, Son [Fri, 7 Apr 2017 01:31:16 +0000 (10:31 +0900)]
packaging: add license files to all sub components
The license files are added to only library components because they could be
included to target binary.
Change-Id: I7cb352ba1457709ba440b1a926056f1b1d74bd3e
Signed-off-by: Chan Lee <chan45.lee@samsung.com>
Signed-off-by: Dongkyun, Son <dongkyun.s@samsung.com>
Chan Lee [Thu, 16 Mar 2017 05:29:15 +0000 (14:29 +0900)]
packaging: provide 64bit libs on 32bit build env
In some cases, especially .Net toolchain needs 64bit libs to execute
even though 32bit build environment.
It's a little weird but possble because almost archtecture of build machine is 64bit.
Change-Id: I0582231028edf64b0cb8e751ec3aba3ccb8e0e0e
Signed-off-by: Chan Lee <chan45.lee@samsung.com>
Dongkyun, Son [Wed, 20 May 2015 01:01:33 +0000 (10:01 +0900)]
Lie about futex_atomic_cmpxchg_inatomic kernel support.
In past versions of glibc, we incorrectly assumed all ARM kernels
in all configurations supported futex_atomic_cmpxchg_inatomic. This
was clearly a lie, however it was a lie that we relied on, because
the fallback implementation appears to not play nicely with certain
applications like pulseaudio. Restore the lie for kernels > 2.6.32
and plug our ears and scream "LA LA LA" about how wrong this is.
Author: Adam Conrad <adconrad@ubuntu.com>
Bug-Ubuntu: https://launchpad.net/bugs/1436162
Last-Update: 2015-03-25
Change-Id: I9d9ceffd5dd2d2f37e45b282317febfb6524b4a8
Signed-off-by: Dongkyun, Son <dongkyun.s@samsung.com>
Pavel Kopyl [Sun, 12 Mar 2017 18:59:01 +0000 (18:59 +0000)]
packaging: Enable memcpy in sysdeps/arm/memcpy.S for ARM
Enable memcpy in sysdeps/arm/memcpy.S for ARM
instead of memcpy in sysdeps/arm/armv7/multiarch/
Turn on --disable-multi-arch option for configure except %{ix86} x86_64 arch.
(port from tizen_3.0_base:
3a309608ceb25843584b0a2c9075c16a1b892e86)
Change-Id: Ia22d4cd3821fea2a7ea0ef2179fc0b4f6e6ef3e9
Signed-off-by: Pavel Kopyl <p.kopyl@samsung.com>
Bartlomiej Grzelewski [Fri, 8 Jul 2016 13:13:30 +0000 (15:13 +0200)]
Nss configuration update
During user switch we must set up groups related with privileges
owned by user. The list of groups is taken from security-manager
service.
Change-Id: I3b01aad84880328e51eccf6ed12f4082f5b639cc
Dongkyun, Son [Wed, 1 Feb 2017 11:08:42 +0000 (20:08 +0900)]
packaging: renamed linaro-glibc.spec -> glibc.spec
Signed-off-by: Dongkyun, Son <dongkyun.s@samsung.com>
Dongkyun, Son [Tue, 18 Oct 2016 23:23:15 +0000 (08:23 +0900)]
packaging: remove fno-omit-frame-pointer from optflags
fix error: bp cannot be used in asm here
(under ../sysdeps/unix/sysv/linux/posix_fallocate.c:39:1)
Signed-off-by: Ivan Baravy <i.baravy@samsung.com>
Signed-off-by: Dongkyun, Son <dongkyun.s@samsung.com>
Dongkyun, Son [Wed, 31 Aug 2016 04:04:39 +0000 (13:04 +0900)]
packaging: disabled libmvec library.
Libmvec is vector math library added in Glibc 2.22.
Signed-off-by: Dongkyun, Son <dongkyun.s@samsung.com>
Dongkyun, Son [Thu, 25 Aug 2016 11:40:28 +0000 (20:40 +0900)]
packaging: fix build error
'bits/stdio-lock.h': No such file or directory
Signed-off-by: Dongkyun, Son <dongkyun.s@samsung.com>
Dongkyun, Son [Thu, 25 Aug 2016 10:48:25 +0000 (19:48 +0900)]
packaging: add packaging
Signed-off-by: Dongkyun, Son <dongkyun.s@samsung.com>
Andreas K. Hüttel [Wed, 31 Jan 2024 00:34:58 +0000 (01:34 +0100)]
Create ChangeLog.old/ChangeLog.28
Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
Andreas K. Hüttel [Wed, 31 Jan 2024 00:29:11 +0000 (01:29 +0100)]
version.h, include/features.h: Bump version to 2.39
Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
Andreas K. Hüttel [Wed, 31 Jan 2024 00:10:02 +0000 (01:10 +0100)]
po: Update translations
Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
Andreas K. Hüttel [Tue, 30 Jan 2024 23:52:00 +0000 (00:52 +0100)]
libc.pot: regenerate
Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
Andreas K. Hüttel [Tue, 30 Jan 2024 23:13:43 +0000 (00:13 +0100)]
INSTALL, install.texi: minor updates, regenerate
Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
Andreas K. Hüttel [Tue, 30 Jan 2024 22:48:12 +0000 (23:48 +0100)]
contrib.texi: update
Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
Andreas K. Hüttel [Tue, 30 Jan 2024 21:40:34 +0000 (22:40 +0100)]
NEWS: insert advisories and fixed bugs for 2.39
Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
Stefan Liebler [Tue, 30 Jan 2024 08:34:32 +0000 (09:34 +0100)]
S390: Fix building with --disable-mutli-arch [BZ #31196]
Starting with commits
-
7ea510127e2067efa07865158ac92c330c379950
string: Add libc_hidden_proto for strchrnul
-
22999b2f0fb62eed1af4095d062bd1272d6afeb1
string: Add libc_hidden_proto for memrchr
building glibc on s390x with --disable-multi-arch fails if only
the C-variant of strchrnul / memrchr is used. This is the case
if gcc uses -march < z13.
The build fails with:
../sysdeps/s390/strchrnul-c.c:28:49: error: ‘__strchrnul_c’ undeclared here (not in a function); did you mean ‘__strchrnul’?
28 | __hidden_ver1 (__strchrnul_c, __GI___strchrnul, __strchrnul_c);
With --disable-multi-arch, __strchrnul_c is not available as string/strchrnul.c
is just included without defining STRCHRNUL and thus we also don't have to create
the internal hidden symbol.
Tested-by: Andreas K. Hüttel <dilfridge@gentoo.org>
Andreas K. Hüttel [Tue, 30 Jan 2024 21:18:42 +0000 (22:18 +0100)]
Fix typo
Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
Joe Simmons-Talbott [Tue, 30 Jan 2024 18:58:34 +0000 (13:58 -0500)]
manual/io: Fix swapped reading and writing phrase.
Reviewed-by: Andreas K. Hüttel <dilfridge@gentoo.org>
Siddhesh Poyarekar [Wed, 24 Jan 2024 18:37:20 +0000 (13:37 -0500)]
Update advisory format and introduce some automation
Simplify the advisory format by dropping the -Backport tags and instead
stick to using just the -Commit tags. To identify backports, put a
substring of git-describe into the release version in the brackets next
to the commit ref. This way, it not only identifies that the fix (or
regression) is on the release/2.YY/master branch, it also disambiguates
regressions/fixes in the branch from those in the tarball.
Add a README to make it easier for consumers to understand the format.
Additionally, the Release wiki needs to be updated to inform the release
manager to:
1. Generate a NEWS snipped from the advisories directory
AND
2. on release/2.YY/master, replace the advisories directory with a text
file pointing to the advisories directory in master so that we don't
have to update multiple locations.
Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
Reviewed-by: Andreas K. Hüttel <dilfridge@gentoo.org>
Arjun Shankar [Tue, 30 Jan 2024 18:29:45 +0000 (19:29 +0100)]
Document CVE-2023-6246, CVE-2023-6779, and CVE-2023-6780
This commit adds "advisories" entries for the above three CVEs.
Arjun Shankar [Mon, 15 Jan 2024 16:44:45 +0000 (17:44 +0100)]
syslog: Fix integer overflow in __vsyslog_internal (CVE-2023-6780)
__vsyslog_internal calculated a buffer size by adding two integers, but
did not first check if the addition would overflow. This commit fixes
that.
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
Arjun Shankar [Mon, 15 Jan 2024 16:44:44 +0000 (17:44 +0100)]
syslog: Fix heap buffer overflow in __vsyslog_internal (CVE-2023-6779)
__vsyslog_internal used the return value of snprintf/vsnprintf to
calculate buffer sizes for memory allocation. If these functions (for
any reason) failed and returned -1, the resulting buffer would be too
small to hold output. This commit fixes that.
All snprintf/vsnprintf calls are checked for negative return values and
the function silently returns upon encountering them.
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Arjun Shankar [Mon, 15 Jan 2024 16:44:43 +0000 (17:44 +0100)]
syslog: Fix heap buffer overflow in __vsyslog_internal (CVE-2023-6246)
__vsyslog_internal did not handle a case where printing a SYSLOG_HEADER
containing a long program name failed to update the required buffer
size, leading to the allocation and overflow of a too-small buffer on
the heap. This commit fixes that. It also adds a new regression test
that uses glibc.malloc.check.
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
Joseph Myers [Tue, 30 Jan 2024 14:20:35 +0000 (14:20 +0000)]
Use binutils 2.42 branch in build-many-glibcs.py
This patch makes build-many-glibcs.py use binutils 2.42 branch.
Tested with build-many-glibcs.py (host-libraries, compilers and glibcs
builds).
Andreas Schwab [Mon, 29 Jan 2024 16:01:07 +0000 (17:01 +0100)]
elf: correct relocation statistics for !ELF_MACHINE_START_ADDRESS
Fixes:
6628c742b2 ("elf: Remove prelink support")
Carlos O'Donell [Thu, 18 Jan 2024 17:28:20 +0000 (12:28 -0500)]
Relicense IBM portions of resolv/base64.c resolv/res_debug.c.
This change relicenses the IBM portions of resolv/base64.c and
resolv/res_debug.c to a new license that does not have use-limited
patent language. The top-level LICENSE file is updated with the
license.
The relicensing was approved by IBM.
Signed-off-by: Brad Topol, IBM Director of Open Technologies <btopol@us.ibm.com>
Signed-off-by: Richard Fontana <rfontana@redhat.com>
Signed-off-by: Carlos O'Donell <carlos@redhat.com>
Mike FABIAN [Thu, 18 Jan 2024 15:52:03 +0000 (16:52 +0100)]
localedata: Use consistent values for grouping and mon_grouping
Resolves: BZ # 31205
Adapt test cases in test-grouping_iterator.c
Dennis Brendel [Mon, 15 Jan 2024 08:55:37 +0000 (09:55 +0100)]
manual: fix order of arguments of memalign and aligned_alloc (Bug 27547)
On the summary page the order of the function arguments was reversed, but it is
in correct order in the other places of the manual.
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Florian Weimer [Wed, 24 Jan 2024 08:34:15 +0000 (09:34 +0100)]
manual, NEWS: Document malloc side effect of dynamic TLS changes
The increased malloc subsystem usage is a side effect of
commit
d2123d68275acc0f061e73d5f86ca504e0d5a344 ("elf: Fix slow tls
access after dlopen [BZ #19924]").
Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>
Florian Weimer [Wed, 24 Jan 2024 08:34:15 +0000 (09:34 +0100)]
NEWS: Update temporary files ignored by ldconfig
Fixes commit
2aa0974d2573441bffd596b07bff8698b1f2f18c ("elf: ldconfig
should skip temporary files created by package managers") and
commit
cfb5a97a93ea656e3b2263e42142a4032986d9ba ("ldconfig: Fixes for
skipping temporary files.").
Reported-by: Guillem Jover <guillem@debian.org>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Andreas K. Hüttel [Tue, 23 Jan 2024 21:28:23 +0000 (22:28 +0100)]
po: Incorporate translations (sr)
Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
Adhemerval Zanella [Mon, 22 Jan 2024 13:42:19 +0000 (10:42 -0300)]
string: Disable stack protector for memset in early static initialization
For ports that use the default memset, the compiler might generate early
calls before the stack protector is initialized (for instance, riscv
with -fstack-protector-all on _dl_aux_init).
Checked on riscv64-linux-gnu-rv64imafdc-lp64d.
Reviewed-by: Florian Weimer <fweimer@redhat.com>
Xi Ruoyao [Mon, 22 Jan 2024 20:29:18 +0000 (04:29 +0800)]
qsort: Fix a typo causing unnecessary malloc/free (BZ 31276)
In qsort_r we allocate a buffer sized QSORT_STACK_SIZE (1024) on stack
and we intend to use it if all elements can fit into it. But there is a
typo:
if (total_size < sizeof buf)
buf = tmp;
else
/* allocate a buffer on heap and use it ... */
Here "buf" is a pointer, thus sizeof buf is just 4 or 8, instead of
1024. There is also a minor issue that we should use "<=" instead of
"<".
This bug is detected debugging some strange heap corruption running the
Ruby-3.3.0 test suite (on an experimental Linux From Scratch build using
Binutils-2.41.90 and Glibc trunk, and also Fedora Rawhide [1]). It
seems Ruby is doing some wild "optimization" by jumping into somewhere
in qsort_r instead of calling it normally, resulting in a double free of
buf if we allocate it on heap. The issue can be reproduced
deterministically with:
LD_PRELOAD=/usr/lib/libc_malloc_debug.so MALLOC_CHECK_=3 \
LD_LIBRARY_PATH=. ./ruby test/runner.rb test/ruby/test_enum.rb
in Ruby-3.3.0 tree after building it. This change would hide the issue
for Ruby, but Ruby is likely still buggy (if using this "optimization"
sorting larger arrays).
[1]:https://kojipkgs.fedoraproject.org/work/tasks/9729/
111889729/build.log
Signed-off-by: Xi Ruoyao <xry111@xry111.site>
Andreas Schwab [Wed, 17 Jan 2024 14:35:57 +0000 (15:35 +0100)]
riscv: add support for static PIE
In order to support static PIE the startup code must avoid relocations
before __libc_start_main is called.
Adhemerval Zanella [Tue, 16 Jan 2024 16:07:47 +0000 (13:07 -0300)]
sh: Fix static build with --enable-fortify
For static the internal symbols should not be prepended with the
internal __GI_.
Checked with a make check for sh4-linux-gnu.
Adhemerval Zanella [Thu, 18 Jan 2024 13:52:18 +0000 (10:52 -0300)]
sparc: Fix sparc64 memmove length comparison (BZ 31266)
The small counts copy bytes comparsion should be unsigned (as the
memmove size argument). It fixes string/tst-memmove-overflow on
sparcv9, where the input size triggers an invalid code path.
Checked on sparc64-linux-gnu and sparcv9-linux-gnu.
Adhemerval Zanella [Wed, 17 Jan 2024 13:38:09 +0000 (10:38 -0300)]
sparc64: Remove unwind information from signal return stubs [BZ#31244]
Similar to sparc32 fix, remove the unwind information on the signal
return stubs. This fixes the regressions:
FAIL: nptl/tst-cancel24-static
FAIL: nptl/tst-cond8-static
FAIL: nptl/tst-mutex8-static
FAIL: nptl/tst-mutexpi8-static
FAIL: nptl/tst-mutexpi9
On sparc64-linux-gnu.
Adhemerval Zanella [Wed, 17 Jan 2024 13:13:06 +0000 (10:13 -0300)]
sparc: Remove 64 bit check on sparc32 wordsize (BZ 27574)
The sparc32 is always 32 bits.
Checked on sparcv9-linux-gnu.
Adhemerval Zanella [Wed, 17 Jan 2024 12:24:55 +0000 (09:24 -0300)]
Use --disable-default-pie for sparc in build-many-glibcs.py
The staticcally built binaries fails without this option [1].
Checked on sparc64-linux-gnu and sparcv9-linux-gnu.
[1] https://sourceware.org/bugzilla/show_bug.cgi?id=29575
Joseph Myers [Fri, 19 Jan 2024 13:30:34 +0000 (13:30 +0000)]
Further build-many-glibcs.py fixes for utcnow() deprecation
It turns out that the replacement of datetime.datetime.utcnow(), for a
warning produced early in running build-many-glibcs.py with Python
3.12, (a) wasn't complete (there were other uses elsewhere in the
script also needing updating) and (b) broke reading of build-time from
build-state.json, because an aware datetime was written out including
+00:00 for the timezone, which was not expected by the strptime call.
Fix the first by making the change to
datetime.datetime.now(datetime.timezone.utc) for all the remaining
utcnow() calls. Fix the second by using strftime with an explicit
format instead of just str() when formatting build times for
build-state.json and and email subjects, and then setting the timezone
explicitly when reading from build-state.json. (Other uses, in
particular messages output by the bot, continue to use str() as the
precise format should not matter in those cases; it shouldn't actually
matter for email subjects either but it seems a good idea to keep
those short.)
Tested with a bot-cycle run and checking the format of times in
build-state.json afterwards.
Daniel Cederman [Fri, 12 Jan 2024 09:26:23 +0000 (10:26 +0100)]
sparc: Do not test preservation of NaN payloads for LEON
The FPU used by LEON does not preserve NaN payload. This change allows
the math/test-*-canonicalize tests to pass on LEON.
Signed-off-by: Daniel Cederman <cederman@gaisler.com>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Daniel Cederman [Tue, 16 Jan 2024 15:16:41 +0000 (16:16 +0100)]
sparc: Force calculation that raises exception
Use the math_force_eval() macro to force the calculation to complete and
raise the exception.
With this change the math/test-fenv test pass.
Signed-off-by: Daniel Cederman <cederman@gaisler.com>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Daniel Cederman [Tue, 16 Jan 2024 08:31:40 +0000 (09:31 +0100)]
sparc: Fix llrint and llround missing exceptions on SPARC V8
Conversions from a float to a long long on SPARC v8 uses a libgcc function
that may not raise the correct exceptions on overflow. It also may raise
spurious "inexact" exceptions on non overflow cases. This patch fixes the
problem in the same way as for RV32.
Signed-off-by: Daniel Cederman <cederman@gaisler.com>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Daniel Cederman [Tue, 16 Jan 2024 08:31:41 +0000 (09:31 +0100)]
sparc: Remove unwind information from signal return stubs [BZ #31244]
The functions were previously written in C, but were not compiled
with unwind information. The ENTRY/END macros includes .cfi_startproc
and .cfi_endproc which adds unwind information. This caused the
tests cleanup-8 and cleanup-10 in the GCC testsuite to fail.
This patch adds a version of the ENTRY/END macros without the
CFI instructions that can be used instead.
sigaction registers a restorer address that is located two instructions
before the stub function. This patch adds a two instruction padding to
avoid that the unwinder accesses the unwind information from the function
that the linker has placed right before it in memory. This fixes an issue
with pthread_cancel that caused tst-mutex8-static (and other tests) to fail.
Signed-off-by: Daniel Cederman <cederman@gaisler.com>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Daniel Cederman [Mon, 15 Jan 2024 14:53:45 +0000 (15:53 +0100)]
sparc: Prevent stfsr from directly following floating-point instruction
On LEON, if the stfsr instruction is immediately following a floating-point
operation instruction in a running program, with no other instruction in
between the two, the stfsr might behave as if the order was reversed
between the two instructions and the stfsr occurred before the
floating-point operation.
Add a nop instruction before the stfsr to prevent this from happening.
Signed-off-by: Daniel Cederman <cederman@gaisler.com>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Daniel Cederman [Mon, 15 Jan 2024 14:53:44 +0000 (15:53 +0100)]
sparc: Use existing macros to avoid code duplication
Macros for using inline assembly to access the fp state register exists
in both fenv_private.h and in fpu_control.h. Let fenv_private.h use the
macros from fpu_control.h
Signed-off-by: Daniel Cederman <cederman@gaisler.com>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Mike FABIAN [Thu, 18 Jan 2024 10:08:48 +0000 (11:08 +0100)]
localedata: renamed: aa_ER@saaho -> ssy_ER
Resolves: BZ # 19956
Mike FABIAN [Thu, 18 Jan 2024 10:01:10 +0000 (11:01 +0100)]
Define ISO 639-3 "ssy" (Saho)
Related: BZ # 19956
References:
https://iso639-3.sil.org/code/ssy
https://en.wikipedia.org/wiki/Saho_language
Mike FABIAN [Thu, 18 Jan 2024 08:15:18 +0000 (09:15 +0100)]
localedata: add crh_RU, Crimean Tartar language in the Cyrillic script as used in Russia.
Resolves: BZ # 24386
Mike FABIAN [Thu, 18 Jan 2024 07:30:34 +0000 (08:30 +0100)]
localedata: tr_TR, ku_TR: Sync with CLDR: “Turkey” -> “Türkiye”
Resolves: BZ # 31257
Mike FABIAN [Wed, 17 Jan 2024 17:25:13 +0000 (18:25 +0100)]
localedata: miq_NI: Shorten month names in abmon
Resolves: BZ # 23172
Joseph Myers [Wed, 17 Jan 2024 21:15:37 +0000 (21:15 +0000)]
Update kernel version to 6.7 in header constant tests
This patch updates the kernel version in the tests tst-mman-consts.py,
tst-mount-consts.py and tst-pidfd-consts.py to 6.7. (There are no new
constants covered by these tests in 6.7 that need any other header
changes.)
Tested with build-many-glibcs.py.
Mike FABIAN [Wed, 17 Jan 2024 16:13:48 +0000 (17:13 +0100)]
localedata: add gbm_IN locale
Resolves: BZ # 19479
Mike FABIAN [Wed, 17 Jan 2024 15:46:12 +0000 (16:46 +0100)]
Define ISO 639-3 "gbm" (Garhwali)
Related: BZ # 19479
References:
https://iso639-3.sil.org/code/gbm
https://en.wikipedia.org/wiki/Garhwali_language
Joseph Myers [Wed, 17 Jan 2024 15:38:54 +0000 (15:38 +0000)]
Update syscall lists for Linux 6.7
Linux 6.7 adds the futex_requeue, futex_wait and futex_wake syscalls,
and enables map_shadow_stack for architectures previously missing it.
Update syscall-names.list and regenerate the arch-syscall.h headers
with build-many-glibcs.py update-syscalls.
Tested with build-many-glibcs.py.
Joseph Myers [Wed, 17 Jan 2024 11:35:35 +0000 (11:35 +0000)]
Use Linux 6.7 in build-many-glibcs.py
This patch makes build-many-glibcs.py use Linux 6.7.
Tested with build-many-glibcs.py (host-libraries, compilers and glibcs
builds).
Adhemerval Zanella [Wed, 17 Jan 2024 11:08:01 +0000 (08:08 -0300)]
stdlib: Remove unused is_aligned function from qsort.c
Checked on x86_64-linux-gnu.
H.J. Lu [Mon, 15 Jan 2024 17:39:03 +0000 (09:39 -0800)]
NEWS: Mention PLT rewrite on x86-64
Mention PLT rewrite on x86-64 for glibc 2.39.
Kuan-Wei Chiu [Tue, 16 Jan 2024 02:16:57 +0000 (10:16 +0800)]
stdlib: Verify heapsort for two-element cases
Adjust the testing approach to start from scenarios with only 2
elements, as insertion sort no longer handles such cases.
Signed-off-by: Kuan-Wei Chiu <visitorckw@gmail.com>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Kuan-Wei Chiu [Tue, 16 Jan 2024 02:16:56 +0000 (10:16 +0800)]
stdlib: Fix heapsort for cases with exactly two elements
When malloc fails to allocate a buffer and falls back to heapsort, the
current heapsort implementation does not perform sorting when there are
exactly two elements. Heapsort is now skipped only when there is
exactly one element.
Signed-off-by: Kuan-Wei Chiu <visitorckw@gmail.com>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Mike FABIAN [Mon, 15 Jan 2024 22:12:48 +0000 (23:12 +0100)]
localedata: anp_IN: Fix abbreviated month names
Resolves: BZ # 31239
The correct abbreviated month names were apparently given in the comment above `abmon`.
But the value of `abmon` was apparently just copied from the value of `mon` and this
mistake was hard to see because code point notation <Uxxxx> was used. After converting
to UTF-8 it was obvious that there was apparently a copy and paste mistake.
Adhemerval Zanella [Mon, 15 Jan 2024 14:07:21 +0000 (11:07 -0300)]
stdlib: Reinstate stable mergesort implementation on qsort
The mergesort removal from qsort implementation (commit
03bf8357e8)
had the side-effect of making sorting nonstable. Although neither
POSIX nor C standard specify that qsort should be stable, it seems
that it has become an instance of Hyrum's law where multiple programs
expect it.
Also, the resulting introsort implementation is not faster than
the previous mergesort (which makes the change even less appealing).
This patch restores the previous mergesort implementation, with the
exception of machinery that checks the resulting allocation against
the _SC_PHYS_PAGES (it only adds complexity and the heuristic not
always make sense depending on the system configuration and load).
The alloca usage was replaced with a fixed-size buffer.
For the fallback mechanism, the implementation uses heapsort. It is
simpler than quicksort, and it does not suffer from adversarial
inputs. With memory overcommit, it should be rarely triggered.
The drawback is mergesort requires O(n) extra space, and since it is
allocated with malloc the function is AS-signal-unsafe. It should be
feasible to change it to use mmap, although I am not sure how urgent
it is. The heapsort is also nonstable, so programs that require a
stable sort would still be subject to this latent issue.
The tst-qsort5 is removed since it will not create quicksort adversarial
inputs with the current qsort_r implementation.
Checked on x86_64-linux-gnu and aarch64-linux-gnu.
Reviewed-by: Florian Weimer <fweimer@redhat.com>
H.J. Lu [Fri, 12 Jan 2024 18:19:41 +0000 (10:19 -0800)]
x86-64: Check if mprotect works before rewriting PLT
Systemd execution environment configuration may prohibit changing a memory
mapping to become executable:
MemoryDenyWriteExecute=
Takes a boolean argument. If set, attempts to create memory mappings
that are writable and executable at the same time, or to change existing
memory mappings to become executable, or mapping shared memory segments
as executable, are prohibited.
When it is set, systemd service stops working if PLT rewrite is enabled.
Check if mprotect works before rewriting PLT. This fixes BZ #31230.
This also works with SELinux when deny_execmem is on.
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Szabolcs Nagy [Wed, 3 Jan 2024 09:06:38 +0000 (09:06 +0000)]
aarch64: Add NEWS entry about libmvec for 2.39
Auto-vectorizing scalar calls is now supported.
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Mike FABIAN [Sun, 14 Jan 2024 10:42:28 +0000 (11:42 +0100)]
localedata/unicode-gen/utf8_gen.py: fix Hangul syllable name
Resolves: BZ # 29506
Sunil K Pandey [Wed, 26 Jul 2023 15:34:05 +0000 (08:34 -0700)]
x86_64: Optimize ffsll function code size.
Ffsll function randomly regress by ~20%, depending on how code gets
aligned in memory. Ffsll function code size is 17 bytes. Since default
function alignment is 16 bytes, it can load on 16, 32, 48 or 64 bytes
aligned memory. When ffsll function load at 16, 32 or 64 bytes aligned
memory, entire code fits in single 64 bytes cache line. When ffsll
function load at 48 bytes aligned memory, it splits in two cache line,
hence random regression.
Ffsll function size reduction from 17 bytes to 12 bytes ensures that it
will always fit in single 64 bytes cache line.
This patch fixes ffsll function random performance regression.
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Mike FABIAN [Fri, 12 Jan 2024 16:04:24 +0000 (17:04 +0100)]
localedata: Remove redundant comments
Yanzhang Wang [Tue, 2 Jan 2024 10:54:15 +0000 (18:54 +0800)]
RISC-V: Enable static-pie.
This patch referents the commit 374cef3 to add static-pie support. And
because the dummy link map is used when relocating ourselves, so need
not to set __global_pointer$ at this time.
It will also check whether toolchain supports to build static-pie.
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Adhemerval Zanella [Tue, 2 Jan 2024 14:31:52 +0000 (11:31 -0300)]
linux: Fix fstat64 on alpha and sparc64
The
551101e8240b7514fc646d1722f8b79c90362b8f change is incorrect for
alpha and sparc, since __NR_stat is defined by both kABI. Use
__NR_newfstat to check whether to fallback to __NR_fstat64 (similar
to what fstatat64 does).
Checked on sparc64-linux-gnu.
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Wilco Dijkstra [Tue, 9 Jan 2024 15:32:08 +0000 (15:32 +0000)]
math: remove exp10 wrappers
Remove the error handling wrapper from exp10. This is very similar to
the changes done to exp and exp2, except that we also need to handle
pow10 and pow10l.
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Wilco Dijkstra [Tue, 2 Jan 2024 17:08:02 +0000 (17:08 +0000)]
Benchtests: Increase benchmark iterations
Increase benchmark iterations for math and vector math functions to improve
timing accuracy. Vector math benchmarks now take 1-3 seconds on a modern CPU.
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Frederic Cambus [Tue, 5 Dec 2023 11:23:07 +0000 (12:23 +0100)]
debug/getwd_chk.c: warning should be emitted for the __getwd_chk symbol.
Otherwise the warning message for the getwd symbol ends up being duplicated.
Signed-off-by: Frederic Cambus <fred@statdns.com>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
Xi Ruoyao [Thu, 4 Jan 2024 13:41:20 +0000 (21:41 +0800)]
Make __getrandom_nocancel set errno and add a _nostatus version
The __getrandom_nocancel function returns errors as negative values
instead of errno. This is inconsistent with other _nocancel functions
and it breaks "TEMP_FAILURE_RETRY (__getrandom_nocancel (p, n, 0))" in
__arc4random_buf. Use INLINE_SYSCALL_CALL instead of
INTERNAL_SYSCALL_CALL to fix this issue.
But __getrandom_nocancel has been avoiding from touching errno for a
reason, see BZ 29624. So add a __getrandom_nocancel_nostatus function
and use it in tcache_key_initialize.
Signed-off-by: Xi Ruoyao <xry111@xry111.site>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
H.J. Lu [Wed, 10 Jan 2024 16:48:47 +0000 (08:48 -0800)]
x86-64/cet: Make CET feature check specific to Linux/x86
CET feature bits in TCB, which are Linux specific, are used to check if
CET features are active. Move CET feature check to Linux/x86 directory.
Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
Andreas K. Hüttel [Thu, 11 Jan 2024 18:46:43 +0000 (19:46 +0100)]
Incorporate translations (zh_CN)
Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
Mike FABIAN [Thu, 11 Jan 2024 15:34:49 +0000 (16:34 +0100)]
Define ISO 639-3 "glk" (Gilaki)
Resolves: BZ # 27163
References:
https://iso639-3.sil.org/code/glk
https://en.wikipedia.org/wiki/Gilaki_language
Stefan Liebler [Thu, 11 Jan 2024 13:01:18 +0000 (14:01 +0100)]
resolv: Fix endless loop in __res_context_query
Starting with commit
40c0add7d48739f5d89ebba255c1df26629a76e2
"resolve: Remove __res_context_query alloca usage"
there is an endless loop in __res_context_query if
__res_context_mkquery fails e.g. if type is invalid. Then the
scratch buffer is resized to MAXPACKET size and it is retried again.
Before the mentioned commit, it was retried only once and with the
mentioned commit, there is no check and it retries in an endless loop.
This is observable with xtest resolv/tst-resolv-qtypes which times out
after 300s.
This patch retries mkquery only once as before the mentioned commit.
Furthermore, scratch_buffer_set_array_size is now only called with
nelem=2 if type is T_QUERY_A_AND_AAAA (also see mentioned commit).
The test tst-resolv-qtypes is also adjusted to verify that <func>
is really returning with -1 in case of an invalid type.
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Mike FABIAN [Thu, 11 Jan 2024 13:17:55 +0000 (14:17 +0100)]
localedata: revert all the remaining locale sources to UTF-8
Mike FABIAN [Thu, 11 Jan 2024 08:14:45 +0000 (09:14 +0100)]
localedata: am_ET ber_DZ en_GB en_PH en_US fil_PH kab_DZ om_ET om_KE ti_ET tl_PH: convert to UTF-8
Mike FABIAN [Wed, 10 Jan 2024 17:00:26 +0000 (18:00 +0100)]
localedata: resolve cyclic dependencies
Resolves: BZ # 24006