platform/upstream/glibc.git
2 months agolinux: Sync Linux 6.6 elf.h 68/306368/1 tizen_base_dev_2.37 accepted/tizen/base/toolchain/20240301.141851 accepted/tizen/base/toolchain/20240301.141955 accepted/tizen/base/x/20240222.075714
Adhemerval Zanella [Tue, 31 Oct 2023 16:32:38 +0000 (13:32 -0300)]
linux: Sync Linux 6.6 elf.h

It adds NT_X86_SHSTK (2fab02b25ae7cf5), NT_RISCV_CSR/NT_RISCV_VECTOR
(9300f00439743c4), and NT_LOONGARCH_HW_BREAK/NT_LOONGARCH_HW_WATCH
(1a69f7a161a78ae).

Change-Id: I5cbbd3afa95830c85114c6357382f3024db79840

3 months agosyslog: Fix heap buffer overflow in __vsyslog_internal (CVE-2023-6246) 30/305430/1 sandbox/vbarinov/cve accepted/tizen/base/x/20240214.091438
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>
Cherry-picked from: 6bd0e4efcc78f3c0115e5ea9739a1642807450da
Change-Id: Ieec10f1d29f4b5040a09cfd96aedcab0addc70fe

3 months agopackaging: remove crts symbolic link from riscv64 45/304145/2 accepted/tizen_base_riscv accepted/tizen/base/riscv/20240116.145842 accepted/tizen/base/toolchain/20240116.105850
Dongkyun Son [Wed, 10 Jan 2024 14:22:20 +0000 (23:22 +0900)]
packaging: remove crts symbolic link from riscv64

Change-Id: I6999fc32a072f491ddfc8a25c259019890f4e778
Signed-off-by: Dongkyun Son <dongkyun.s@samsung.com>
6 months agoFix leak in getaddrinfo introduced by the fix for CVE-2023-4806 [BZ #30843] 83/300483/1 accepted/tizen/base/riscv/20231123.094543
Romain Geissler [Mon, 25 Sep 2023 00:21:51 +0000 (01:21 +0100)]
Fix leak in getaddrinfo introduced by the fix for CVE-2023-4806 [BZ #30843]

This patch fixes a very recently added leak in getaddrinfo.

This was assigned CVE-2023-5156.

Resolves: BZ #30884
Related: BZ #30842

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
(cherry picked from commit ec6b95c3303c700eb89eebeda2d7264cc184a796)

Change-Id: I9ecce0e999a0f3faa9b295b35ea3deb1431208ce

6 months agopackaging: Make glibc-devel symlinks consistent 10/300210/1
Slava Barinov [Wed, 18 Oct 2023 12:08:47 +0000 (15:08 +0300)]
packaging: Make glibc-devel symlinks consistent

Currently manually created symlinks are pointing to the same directory, while
automatically created ones point to ../../lib so let's make them consistent

Change-Id: I623d7cd6a410f64e3ed2481d3c3374da0c9c5c94
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
6 months agogetaddrinfo: Fix use after free in getcanonname (CVE-2023-4806) 17/299617/1
Siddhesh Poyarekar [Fri, 15 Sep 2023 17:51:12 +0000 (13:51 -0400)]
getaddrinfo: Fix use after free in getcanonname (CVE-2023-4806)

When an NSS plugin only implements the _gethostbyname2_r and
_getcanonname_r callbacks, getaddrinfo could use memory that was freed
during tmpbuf resizing, through h_name in a previous query response.

The backing store for res->at->name when doing a query with
gethostbyname3_r or gethostbyname2_r is tmpbuf, which is reallocated in
gethosts during the query.  For AF_INET6 lookup with AI_ALL |
AI_V4MAPPED, gethosts gets called twice, once for a v6 lookup and second
for a v4 lookup.  In this case, if the first call reallocates tmpbuf
enough number of times, resulting in a malloc, th->h_name (that
res->at->name refers to) ends up on a heap allocated storage in tmpbuf.
Now if the second call to gethosts also causes the plugin callback to
return NSS_STATUS_TRYAGAIN, tmpbuf will get freed, resulting in a UAF
reference in res->at->name.  This then gets dereferenced in the
getcanonname_r plugin call, resulting in the use after free.

Fix this by copying h_name over and freeing it at the end.  This
resolves BZ #30843, which is assigned CVE-2023-4806.

Change-Id: I60f3106d2045ff78b80993e7a5c9f85235955bc6
Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
Commit: 973fe93a5675c42798b2161c6f29c01b0e243994

6 months agoCVE-2023-4527: Stack read overflow with large TCP responses in no-aaaa mode 16/299616/1
Florian Weimer [Wed, 13 Sep 2023 12:10:56 +0000 (14:10 +0200)]
CVE-2023-4527: Stack read overflow with large TCP responses in no-aaaa mode

Without passing alt_dns_packet_buffer, __res_context_search can only
store 2048 bytes (what fits into dns_packet_buffer).  However,
the function returns the total packet size, and the subsequent
DNS parsing code in _nss_dns_gethostbyname4_r reads beyond the end
of the stack-allocated buffer.

Fixes commit f282cdbe7f436c75864e5640a4 ("resolv: Implement no-aaaa
stub resolver option") and bug 30842.

Change-Id: I9e8ba9ac73820438f7ff6a3ccb49f57c6e6f6bca
Commit: bd77dd7e73e3530203be1c52c8a29d08270cb25d

6 months agotunables: Terminate if end of input is reached (CVE-2023-4911) 85/299585/2
Siddhesh Poyarekar [Tue, 19 Sep 2023 22:39:32 +0000 (18:39 -0400)]
tunables: Terminate if end of input is reached (CVE-2023-4911)

The string parsing routine may end up writing beyond bounds of tunestr
if the input tunable string is malformed, of the form name=name=val.
This gets processed twice, first as name=name=val and next as name=val,
resulting in tunestr being name=name=val:name=val, thus overflowing
tunestr.

Terminate the parsing loop at the first instance itself so that tunestr
does not overflow.

This also fixes up tst-env-setuid-tunables to actually handle failures
correct and add new tests to validate the fix for this CVE.

Change-Id: I2e6721f2f17f5079cceb5e5803a39856e483c2dd
Commit: 1056e5b4c3f2d90ed2b4a55f96add28da2f4c8fa
Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
8 months agopackaging: Restore unversioned symlinks for nss_dns and nss_files 08/297808/1
Slava Barinov [Thu, 24 Aug 2023 11:29:17 +0000 (14:29 +0300)]
packaging: Restore unversioned symlinks for nss_dns and nss_files

These symlinks are not created automatically anymore

Change-Id: If3c6b3f2bf28cc666146490282a755a0a377f205
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
9 months agocreate ld soft link 06/296006/3 submit/tizen_base_dev/20230731.024114
VBS [Tue, 4 Jul 2023 04:36:54 +0000 (10:06 +0530)]
create ld soft link

Since ld path is changed from lib to lib64 also stack holds some prebuild
libs previous ld also needed
So this "crate ld soft link" patch will fix below errors

[ 11s] now finalizing build dir...
[ 11s] qemu-aarch64: Could not open '/lib/ld-linux-aarch64.so.1': No
such file or directory
[ 11s] qemu-aarch64: Could not open '/lib/ld-linux-aarch64.so.1': No
such file or directory
[ 12s] qemu-aarch64: Could not open '/lib/ld-linux-aarch64.so.1': No
such file or directory
[ 12s] Error: TOPDIR empty

After this patch
[root@DELL-BUILD01 /]# ls -l /usr/lib/ld-linux-aarch64.so.1
lrwxrwxrwx 1 root root 28 Jul  4 04:55 /usr/lib/ld-linux-aarch64.so.1 ->
/lib64/ld-linux-aarch64.so.1

Change-Id: I45a2df431ccb705f04f97d5fd5e5e21e1e5f6d6f

9 months agochange LD default path 05/296005/2
VBS [Tue, 4 Jul 2023 04:28:53 +0000 (09:58 +0530)]
change LD default path

change ld default path from lib to lib64

Before patch ld path
/usr/lib/ld-linux-aarch64.so.1

After patch ld path
/usr/lib64/ld-linux-aarch64.so.1

Change-Id: I63b551eab949cb595dd6f0266ff8fa84186fd39b

9 months agoRevert "packaging: remove nis/ nss" 08/296008/4 submit/tizen_base_dev/20230727.072457
Dongkyun Son [Tue, 18 Jul 2023 07:44:00 +0000 (16:44 +0900)]
Revert "packaging: remove nis/ nss"

This reverts commit 4224b22e1728dae6f0b6731fcb2cddd0cf39d425.

Change-Id: I6aa9cbcdc8d9a5fb9db84e973b72885e25aca91f

9 months agoFixed the issue of tizen-locale for riscv64 25/295425/1 accepted/tizen_base_tool_dev accepted/tizen/base/tool/dev/20230707.094314 submit/tizen_base_dev/20230707.050128
wchang kim [Fri, 7 Jul 2023 02:56:37 +0000 (11:56 +0900)]
Fixed the issue of tizen-locale for riscv64

Change-Id: Ib18134121169402c4c836f899af9896ddb1641d3

10 months agopackaging: Support riscv64 build 51/295251/1
wchang kim [Tue, 4 Jul 2023 07:29:47 +0000 (16:29 +0900)]
packaging: Support riscv64 build

Change-Id: I21daa40efaa528ef8fc9fe13ab3c4a5ed38e6622
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
10 months agoRevert "elf: Refuse to dlopen PIE objects [BZ #24323]" 37/295237/1
Dongkyun Son [Wed, 22 Jan 2020 10:10:22 +0000 (19:10 +0900)]
Revert "elf: Refuse to dlopen PIE objects [BZ #24323]"

This reverts commit 2c75b545de6fe3c44138799c68217a94bc669a88.

Tizen C/C++ application uses launchpad-loader to improve application execution
speed. When the application execution request is received, the launchpad-loader
opens the executables of the application built with -fPIE via dlopen() to call
the main() function. With this patch, the launchpad-loader cannot open the
executables via dlopen().

Change-Id: I9c994a27890c8954e64d9bea566a63f03682a570

12 months agopackaging: Bump version to 2.37 accepted/tizen/base/tool/dev/20230608.110732 submit/tizen_base_dev/20230607.110014
Dongkyun Son [Fri, 13 Jan 2023 11:49:06 +0000 (20:49 +0900)]
packaging: Bump version to 2.37

- nss_dns: Remove remnants of IPv6 address mapping
- Remove ldd libc4 support

Change-Id: I3fa6c32891ca98867f8d73f77d171d60579b7919
Signed-off-by: Dongkyun Son <dongkyun.s@samsung.com>
12 months agoRemove -flto=* if present
Slava Barinov [Tue, 21 Mar 2023 09:19:03 +0000 (12:19 +0300)]
Remove -flto=* if present

Currently glibc can't be built with LTO

Change-Id: Ifefb67b8a7274fabae29fcd7aa966eb0ca7abb1b
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
12 months agoRestore optfiles
Slava Barinov [Fri, 3 Mar 2023 09:36:48 +0000 (12:36 +0300)]
Restore optfiles

Change-Id: I29698165781572e7ff5055ebd804ef438666953c

12 months agoSeparate ld.so for qemu-accel added
Slava Barinov [Fri, 3 Mar 2023 09:12:53 +0000 (12:12 +0300)]
Separate ld.so for qemu-accel added

Change-Id: I583e31bd58e9d1cc1f3dd55d13374815d826ed4e

12 months agoFix install order, glibc-devel should be installed after gcc
Slava Barinov [Thu, 2 Mar 2023 09:21:50 +0000 (12:21 +0300)]
Fix install order, glibc-devel should be installed after gcc

Change-Id: I861f383348d31acb8141f0c82b4d1c0b2b7c6f67

12 months agoAdd symlinks into %install and packaging
Slava Barinov [Tue, 28 Feb 2023 12:46:50 +0000 (15:46 +0300)]
Add symlinks into %install and packaging

Change-Id: I32e81e183ed4e84c76de8c8b86aafe00c20ea126
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
12 months agoAdd packaging for ld-linux.so on %ix86
Slava Barinov [Wed, 22 Feb 2023 09:18:15 +0000 (12:18 +0300)]
Add packaging for ld-linux.so on %ix86

Change-Id: I6b8b73833c0d94ff3d9a74b7068f3d1f3cba6262

12 months agoRestore symlink to ld-linux.so
Slava Barinov [Wed, 22 Feb 2023 09:16:27 +0000 (12:16 +0300)]
Restore symlink to ld-linux.so

This should fix qemu-accel build

Change-Id: I8711f15784d56e6091041eb493e38d39f15d1469

12 months agoMove symlink into script
Slava Barinov [Wed, 15 Feb 2023 12:10:12 +0000 (15:10 +0300)]
Move symlink into script

Change-Id: I081ddb32ad6f19c226c5cd0977f31ef635fe6146

12 months agoFix 32bit libpthread symlink
Slava Barinov [Wed, 15 Feb 2023 11:00:54 +0000 (14:00 +0300)]
Fix 32bit libpthread symlink

Change-Id: I641894f196ee41e76e5fd7224af367f1085a956d

12 months agoAdd script to devel-static as well
Slava Barinov [Wed, 15 Feb 2023 10:25:02 +0000 (13:25 +0300)]
Add script to devel-static as well

Change-Id: I7ad8a24b2d65f4c572d676d4372369ce64be0ee9

12 months agoFixes of symlink and script
Slava Barinov [Wed, 15 Feb 2023 09:54:29 +0000 (12:54 +0300)]
Fixes of symlink and script

Change-Id: I340e89ae96ce11c9a879432c814b1be9ba6b4991

12 months agoUse c, not c++ for header fix
Slava Barinov [Wed, 15 Feb 2023 09:18:01 +0000 (12:18 +0300)]
Use c, not c++ for header fix

Change-Id: If41c39944e7b813070ee899195017bff61cd2c7e
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
12 months agolibpthread symlink fix
Slava Barinov [Wed, 15 Feb 2023 08:26:16 +0000 (11:26 +0300)]
libpthread symlink fix

Change-Id: I2cb367b7765b7ac24b3534f5add3acf4674f9495

12 months agoTemporary fix of include-fixed header
Slava Barinov [Wed, 15 Feb 2023 07:22:57 +0000 (10:22 +0300)]
Temporary fix of include-fixed header

Change-Id: I50e47a5f04289878a26cd6f0793420aba20dc242

12 months agopackaing: switch off build_html
Dongkyun Son [Fri, 27 Jan 2023 10:14:43 +0000 (19:14 +0900)]
packaing: switch off build_html

FIXME

    glibc-2.36/manual//math.texi:568: Unknown command `U'.
    glibc-2.36/manual//math.texi:568: Misplaced {.
    glibc-2.36/manual//math.texi:568: Misplaced }.

Change-Id: I0f9ad489ab30433b9ba38260234b81bf87b445e9
Signed-off-by: Dongkyun Son <dongkyun.s@samsung.com>
12 months agopackaging: New installation path for zdump
Łukasz Stelmach [Fri, 29 Jul 2022 18:50:10 +0000 (20:50 +0200)]
packaging: New installation path for zdump

See b4f020c9b4 ("timezone: Change zdump installation to bin directory")

Change-Id: Ie16596aeec41e681501b31074becca3ec047ae0b
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
12 months agopackaging: add /usr/bin/ld.so
Łukasz Stelmach [Fri, 29 Jul 2022 18:47:07 +0000 (20:47 +0200)]
packaging: add /usr/bin/ld.so

See 2e75604f83 ("elf: Install a symbolic link to ld.so as /usr/bin/ld.so")

Change-Id: I6aa864b42ced14cf94069f896ee6bcd722183e59
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
12 months agopackaging: add libc_malloc_debug.so.0
Łukasz Stelmach [Fri, 29 Jul 2022 18:40:13 +0000 (20:40 +0200)]
packaging: add libc_malloc_debug.so.0

See 2d2d9f2b48 ("Move malloc hooks into a compat DSO")

Change-Id: I7d6be0b77516cc8a419c1542e1b3ebe372e7a8d5
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
12 months agopackaging: drop catchsegv and libSegFault
Łukasz Stelmach [Fri, 29 Jul 2022 18:06:10 +0000 (20:06 +0200)]
packaging: drop catchsegv and libSegFault

See 65ccd641ba ("debug: Remove catchsegv and libSegfault (BZ #14913)")

Change-Id: If9f97b7d3e5ec6ca056c0feb23516a2ae9f586f6
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
12 months agopackaging: drop obsolete Sun RPC stuff
Łukasz Stelmach [Fri, 29 Jul 2022 17:39:23 +0000 (19:39 +0200)]
packaging: drop obsolete Sun RPC stuff

See 5500cdba40 ("Remove --enable-obsolete-rpc configure flag")

Change-Id: I6712ccf33790ed23cc96507171367bfc65cfda21
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
12 months agopackaging: fix rpmbuild errors
Dongkyun Son [Mon, 16 Jan 2023 02:56:04 +0000 (11:56 +0900)]
packaging: fix rpmbuild errors

Macro expanded in comment on line 810: %{_lib}/obsolete/noversion
Macro expanded in comment on line 811: %{_lib}/obsolete/noversion/libNoVersion.so.1

Change-Id: Ib8111cfc9fa90dfe77175a28cef44464715e47fd
Signed-off-by: Dongkyun Son <dongkyun.s@samsung.com>
12 months agopackaging: install libthread_db under a regular name
Łukasz Stelmach [Fri, 29 Jul 2022 17:17:34 +0000 (19:17 +0200)]
packaging: install libthread_db under a regular name

See 86f0179bc0 ("nptl_db: Install libthread_db under a regular implementation name")

Change-Id: Id2da2b8d2d9a9c0f51d9f6f0a4254f385d5e15f1
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
12 months agopackaging: Install libraries under ABI names
Łukasz Stelmach [Fri, 29 Jul 2022 09:07:54 +0000 (11:07 +0200)]
packaging: Install libraries under ABI names

See 8208be389b ("Install shared objects under their ABI names")

Change-Id: I97578a7747668da9b5755e80ab8cf1f75a974b24
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
12 months agopackaging: remove nis/ nss
Dongkyun Son [Mon, 16 Jan 2023 01:33:59 +0000 (10:33 +0900)]
packaging: remove nis/ nss

Fix install error :

+ install -m 644 nis/nss /home/abuild/rpmbuild/BUILDROOT/glibc-2.36-0.i386/etc/default/
install: cannot stat `nis/nss': No such file or directory

Change-Id: Ic0e0585748e01e5dc9f4809aec296bcf9df9e8de
Signed-off-by: Dongkyun Son <dongkyun.s@samsung.com>
12 months agotizen: Use getline() when building nss_optfiles
Łukasz Stelmach [Thu, 21 Jul 2022 21:02:23 +0000 (23:02 +0200)]
tizen: Use getline() when building nss_optfiles

After moving to libc (6212bb67f4 "nss_files: Move into libc") started
using __getline() (0e1f068108 "Fix linknamespace errors and
local-plt-usages in nss_files.") which is not available when building
nss_optfiles as a module.

Change-Id: I1e7443bcb64b6c63c8d47b53afdc3e8916702416
Fixes: 0b9125e2a3 ("tizen: Add optfiles nss module")
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
12 months agopackaging: Fix asan build on aarh64
Dongkyun Son [Thu, 28 Jul 2022 23:59:06 +0000 (08:59 +0900)]
packaging: Fix asan build on aarh64

    When running 2nd glibc build for asan, there are errors from
    conflicting types for fgetpos and fsetpos. This is from not
    matched LARGEFILE related definitions. Undefine the related
    definitions like armv7l build.

Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Dongkyun Son <dongkyun.s@samsung.com>
Change-Id: I3d2f3ddaceca9bd55adec83b775760d1f42fdd09

12 months agopackaging: Add support for enable_static_pie project config macro
Slava Barinov [Tue, 27 Jul 2021 09:01:09 +0000 (12:01 +0300)]
packaging: Add support for enable_static_pie project config macro

This switch will turn on support for static PIE binaries build for glibc.

Change-Id: I2ff4be151aafe91bbdc2a7ae9f89a11b54b106f5
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
12 months ago[HWASan] Prepare hwasan-enabled build
Slava Barinov [Thu, 19 Aug 2021 11:05:29 +0000 (14:05 +0300)]
[HWASan] Prepare hwasan-enabled build

Package glibc-hwasan.rpm provides HWASan-sanitized version of glibc for testing
purposes.

Change-Id: Ie5a3ba6b80823dbc422b281846d64a6740674d2c
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
12 months ago[HWASan] Unforce gcc options for hwasan build
Andrey Kazmin [Thu, 11 Mar 2021 08:26:27 +0000 (11:26 +0300)]
[HWASan] Unforce gcc options for hwasan build

Change-Id: If4d164bcb9ed349fbf29eb324da73e869d639a62
Signed-off-by: Andrey Kazmin <a.kazmin@partner.samsung.com>
12 months agoTurn off tst-udp-timeout test
Slava Barinov [Tue, 13 Jul 2021 10:24:55 +0000 (13:24 +0300)]
Turn off tst-udp-timeout test

The test is flaky and causes freeze both in buildroot and on RPi

Change-Id: I9621b110e3b085b16a369d92d2b322f798aaab1a
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
12 months agoaarch64: Remove file offset flags from Glibc build
Dongkyun Son [Wed, 23 Jun 2021 11:00:42 +0000 (20:00 +0900)]
aarch64: Remove file offset flags from Glibc build

update commit: 565c59bcea65d00c519fa5a2e5285721c50a6c6b

Change-Id: Id8644cd6f96d5d0b8bd41776433d4727e4b1ea34
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
Signed-off-by: Dongkyun Son <dongkyun.s@samsung.com>
12 months agopackaging: Add -k flag to 'make check'
Slava Barinov [Wed, 14 Apr 2021 12:49:45 +0000 (15:49 +0300)]
packaging: Add -k flag to 'make check'

Currently make fails and test procedure stops after first failed test.

Change-Id: I28dce3ee30a7d0ac240b46e01c9a23e59b3ed61a
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
12 months agopackaging: Clean up build procedure
Slava Barinov [Mon, 18 Jan 2021 16:23:38 +0000 (19:23 +0300)]
packaging: Clean up build procedure

- Redundant functions removed, build simplified
- Build directory renamed to "build"
- Test procedure fixed, including run_tests_on_device mode
- testresults.rpm package enhanced and now contains test output

Change-Id: Ia3754697d6cff7e79b20be09450a20513d066383

12 months agopackaging: Add support for %run_tests_on_device
Slava Barinov [Wed, 9 Sep 2020 13:52:45 +0000 (16:52 +0300)]
packaging: Add support for %run_tests_on_device

This variable allows to prepare buildroot for running testsuite on device

Change-Id: I14d652d198f65f6662bf22deb23d6cbf6dd156af
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
12 months agopackaging: Add support for configure-dumper
Slava Barinov [Thu, 4 Jun 2020 14:01:00 +0000 (17:01 +0300)]
packaging: Add support for configure-dumper

Change-Id: Id52b2d7c5f5fd8ab391ee2f8d872937c0108ef3c
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
12 months agopackaging: Fix ASan build for armv7l
Slava Barinov [Thu, 30 Apr 2020 14:27:23 +0000 (17:27 +0300)]
packaging: Fix ASan build for armv7l

Change-Id: I61ea1881efd00fd9377db78d4398311b01540b77
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
12 months agopackaging: Support 32bit build for armv8-a CPU
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>
12 months agoRevert "packaging: remove '-g' option to ix86's BuildFlags."
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

12 months agopackaging: add support option for -fstack-protector-strong
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>
12 months agopackaging: Turning on PIE compilation by default
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>
12 months agopackaging: remove '-g' option to ix86's BuildFlags.
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>
12 months agoRevert "REMOVE ME: turn off crti/crtn debug section"
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

12 months agoREMOVE ME: turn off crti/crtn debug section
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>
12 months agoRemove file offset flags from Glibc build
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>
12 months agoBuild glibc itself with default offset bits
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>
12 months agoAdd rpm with testresults
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

12 months ago[Tizen 6.0] Release 2.30 version
Mikhail Kashkarov [Thu, 28 Nov 2019 16:01:23 +0000 (19:01 +0300)]
[Tizen 6.0] Release 2.30 version

12 months agoSmack: add acess label to ldconfig to prevent privilege escalation
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>
12 months agopackaging: add --disable-experimental-malloc
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>
12 months agotizen: Add optfiles nss module
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

12 months agoRepair glibc make check with -Wformat options enabled.
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

12 months ago[ASan] Enable build with ASan.
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

12 months agopackaging: Apply ASLR
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>
12 months agopackaging: Switch off ASan
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>
12 months agopackaging: add license files to all sub components
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>
12 months agopackaging: provide 64bit libs on 32bit build env
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>
12 months agoLie about futex_atomic_cmpxchg_inatomic kernel support.
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>
12 months agopackaging: Enable memcpy in sysdeps/arm/memcpy.S for ARM
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>
12 months agoNss configuration update
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

12 months agopackaging: renamed linaro-glibc.spec -> glibc.spec
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>
12 months agopackaging: remove fno-omit-frame-pointer from optflags
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>
12 months agopackaging: disabled libmvec library.
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>
12 months agopackaging: fix build error
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>
12 months agopackaging: add packaging
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>
15 months agoCreate ChangeLog.old/ChangeLog.26. upstream-2.37 upstream/2.37
Carlos O'Donell [Wed, 1 Feb 2023 03:27:45 +0000 (22:27 -0500)]
Create ChangeLog.old/ChangeLog.26.

15 months agoPrepare for glibc 2.37 release.
Carlos O'Donell [Wed, 1 Feb 2023 02:29:05 +0000 (21:29 -0500)]
Prepare for glibc 2.37 release.

Update version.h, and include/features.h.

15 months agox86: Fix strncat-avx2.S reading past length [BZ #30065]
Noah Goldstein [Tue, 31 Jan 2023 23:46:56 +0000 (17:46 -0600)]
x86: Fix strncat-avx2.S reading past length [BZ #30065]

Occurs when `src` has no null-term.

Two cases:

1) Zero-length check is doing:
```
    test    %rdx, %rdx
    jl      L(zero_len)
```
which doesn't actually check zero (was at some point `decq` and the
flag never got updated).

The fix is just make the flag `jle` i.e:
```
    test    %rdx, %rdx
    jle     L(zero_len)
```

2) Length check in page-cross case checking if we should continue is
doing:
```
    cmpq    %r8, %rdx
    jb      L(page_cross_small)
```
which means we will continue searching for null-term if length ends at
the end of a page and there was no null-term in `src`.

The fix is to make the flag:
```
    cmpq    %r8, %rdx
    jbe     L(page_cross_small)
```

15 months agoUpdate install.texi, and regenerate INSTALL.
Carlos O'Donell [Tue, 31 Jan 2023 22:15:24 +0000 (17:15 -0500)]
Update install.texi, and regenerate INSTALL.

15 months agoUpdate manual/contrib.texi.
Carlos O'Donell [Tue, 31 Jan 2023 22:01:30 +0000 (17:01 -0500)]
Update manual/contrib.texi.

Thank Yinyu Cai for their maintainership of the LoongArch port.

Thank Vineet Gupta for their maintainership of the ARC port.

Thank Tulio Magno Quites Machado Filho for their past maintainership
of the PowerPC port.

Thank Rajalakshmi Srinivasaraghavan for their current maintainership
of the PowerPC port.

15 months agoUpdate NEWS file with bug fixes.
Carlos O'Donell [Tue, 31 Jan 2023 22:00:58 +0000 (17:00 -0500)]
Update NEWS file with bug fixes.

15 months agoRegenerate configure.
Carlos O'Donell [Tue, 31 Jan 2023 21:48:15 +0000 (16:48 -0500)]
Regenerate configure.

Run using vanilla upstream autoconf 2.69.

Minor whitespace change to sysdeps/loongarch/configure and
sysdeps/mach/configure, and nothing else.

15 months agoUpdate all PO files in preparation for release.
Carlos O'Donell [Tue, 31 Jan 2023 21:30:44 +0000 (16:30 -0500)]
Update all PO files in preparation for release.

15 months agodoc: correct _FORTIFY_SOURCE doc in features.h
fanquake [Tue, 31 Jan 2023 13:25:11 +0000 (13:25 +0000)]
doc: correct _FORTIFY_SOURCE doc in features.h

15 months agolibio: Update number of written bytes in dprintf implementation
Florian Weimer [Tue, 31 Jan 2023 21:22:02 +0000 (22:22 +0100)]
libio: Update number of written bytes in dprintf implementation

The __printf_buffer_flush_dprintf function needs to record that
the buffer has been written before reusing it.  Without this
accounting, dprintf always returns zero.

Fixes commit 8ece45e4f586abd212d1c02d74d38ef681a45600
("libio: Convert __vdprintf_internal to buffers").

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
15 months agoAccount for octal marker in %#o format
Andreas Schwab [Fri, 27 Jan 2023 22:25:59 +0000 (23:25 +0100)]
Account for octal marker in %#o format

15 months agoUse binutils 2.40 branch in build-many-glibcs.py
Joseph Myers [Fri, 27 Jan 2023 20:53:50 +0000 (20:53 +0000)]
Use binutils 2.40 branch in build-many-glibcs.py

This patch makes build-many-glibcs.py use binutils 2.40 branch.

Tested with build-many-glibcs.py (host-libraries, compilers and glibcs
builds).

15 months agoUse MPFR 4.2.0, MPC 1.3.1 in build-many-glibcs.py
Joseph Myers [Fri, 27 Jan 2023 18:27:26 +0000 (18:27 +0000)]
Use MPFR 4.2.0, MPC 1.3.1 in build-many-glibcs.py

This patch makes build-many-glibcs.py use the new MPFR 4.2.0 and MPC
1.3.1 releases.

Tested with build-many-glibcs.py (host-libraries, compilers and glibcs
builds).

15 months agostdio-common: Handle -1 buffer size in __sprintf_chk & co (bug 30039)
Florian Weimer [Wed, 25 Jan 2023 07:01:00 +0000 (08:01 +0100)]
stdio-common: Handle -1 buffer size in __sprintf_chk & co (bug 30039)

This shows up as an assertion failure when sprintf is called with
a specifier like "%.8g" and libquadmath is linked in:

Fatal glibc error: printf_buffer_as_file.c:31
  (__printf_buffer_as_file_commit): assertion failed:
  file->stream._IO_write_ptr <= file->next->write_end

Fix this by detecting pointer wraparound in __vsprintf_internal
and saturate the addition to the end of the address space instead.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
15 months agoDocument '%F' format specifier
Paul Pluzhnikov [Wed, 25 Jan 2023 00:39:31 +0000 (00:39 +0000)]
Document '%F' format specifier

The '%F' format specifier was implemented in commit 6c46718f9f0 on
2000-08-23, but remains undocumented in the manual.
https://stackoverflow.com/questions/75157669/format-specifier-f-missing-from-glibcs-documentation

Fix that.

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
15 months agosparc (64bit): Regenerate ulps
Andreas K. Hüttel [Sun, 22 Jan 2023 23:46:02 +0000 (00:46 +0100)]
sparc (64bit): Regenerate ulps

Linux catbus 5.15.69-gentoo #1 SMP Sat Sep 24 07:56:24 PDT 2022 sparc64 sun4v UltraSparc T5 (Niagara5) GNU/Linux
gcc (Gentoo 11.3.1_p20221209 p3) 11.3.1 20221209
GNU ld (Gentoo 2.38 p4) 2.38
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
15 months agoia64: Regenerate ulps
Andreas K. Hüttel [Sun, 22 Jan 2023 18:32:17 +0000 (19:32 +0100)]
ia64: Regenerate ulps

Linux guppy 5.13.0-00002-gdecb01746d6c #368 SMP Sat Aug 14 20:10:13 UTC 2021 ia64 Dual-Core Intel(R) Itanium(R) Processor 9040 GenuineIntel GNU/Linux
gcc (Gentoo 12.2.1_p20221231 p8) 12.2.1 20221231
GNU ld (Gentoo 2.40 p1) 2.40
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
15 months agoUpdate libc.pot for 2.37 release.
Carlos O'Donell [Mon, 23 Jan 2023 13:49:29 +0000 (08:49 -0500)]
Update libc.pot for 2.37 release.

15 months agox86: Cache computation for AMD architecture.
Sajan Karumanchi [Wed, 18 Jan 2023 17:29:04 +0000 (18:29 +0100)]
x86: Cache computation for AMD architecture.

All AMD architectures cache details will be computed based on
__cpuid__ `0x8000_001D` and the reference to __cpuid__ `0x8000_0006` will be
zeroed out for future architectures.

Reviewed-by: Premachandra Mallappa <premachandra.mallappa@amd.com>
15 months agomanual: Fix typo
Martin Joerg [Wed, 18 Jan 2023 17:34:08 +0000 (18:34 +0100)]
manual: Fix typo

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>