Sync with upstream branch release/2.39/master (RHEL-34577, RHEL-35602)

Upstream commit: 6ade91c21140d8c803c289932dbfc74537f65a1f

- elf: Avoid some free (NULL) calls in _dl_update_slotinfo

- misc: Add support for Linux uio.h RWF_NOAPPEND flag

Resolves: RHEL-34577

- i386: Disable Intel Xeon Phi tests for GCC 15 and above (BZ 31782)
- Reinstate generic features-time64.h
- Always define __USE_TIME_BITS64 when 64 bit time_t is used
- socket: Use may_alias on sockaddr structs (bug 19622)
- parse_fdinfo: Don't advance pointer twice [BZ #31798]
- LoongArch: Fix undefined `__memset_aligned` reference in ld.so linking.
- socket: Add new test for connect
- libsupport: Add xgetpeername
- x86_64: Fix missing wcsncat function definition without multiarch (x86-64-v4)

Resolves: RHEL-35602

Fedora 40 commit: fec1cd8ce1001d62922c39fded760a8e2c6fd344
This commit is contained in:
Arjun Shankar 2024-06-07 15:39:08 +02:00
parent 1eabd6588f
commit 657b0dc854
12 changed files with 2573 additions and 1 deletions

View File

@ -0,0 +1,38 @@
commit ab4ef4421f85ea7afeb482ded51003658b08de7e
Author: Gabi Falk <gabifalk@gmx.com>
Date: Tue May 7 18:25:00 2024 +0000
x86_64: Fix missing wcsncat function definition without multiarch (x86-64-v4)
This code expects the WCSCAT preprocessor macro to be predefined in case
the evex implementation of the function should be defined with a name
different from __wcsncat_evex. However, when glibc is built for
x86-64-v4 without multiarch support, sysdeps/x86_64/wcsncat.S defines
WCSNCAT variable instead of WCSCAT to build it as wcsncat. Rename the
variable to WCSNCAT, as it is actually a better naming choice for the
variable in this case.
Reported-by: Kenton Groombridge
Link: https://bugs.gentoo.org/921945
Fixes: 64b8b6516b ("x86: Add evex optimized functions for the wchar_t strcpy family")
Signed-off-by: Gabi Falk <gabifalk@gmx.com>
Reviewed-by: Sunil K Pandey <skpgkp2@gmail.com>
(cherry picked from commit dd5f891c1ad9f1b43b9db93afe2a55cbb7a6194e)
diff --git a/sysdeps/x86_64/multiarch/wcsncat-evex.S b/sysdeps/x86_64/multiarch/wcsncat-evex.S
index 392215950afd56be..10bfb0a5314130cf 100644
--- a/sysdeps/x86_64/multiarch/wcsncat-evex.S
+++ b/sysdeps/x86_64/multiarch/wcsncat-evex.S
@@ -1,9 +1,9 @@
-#ifndef WCSCAT
-# define WCSCAT __wcsncat_evex
+#ifndef WCSNCAT
+# define WCSNCAT __wcsncat_evex
#endif
#define USE_AS_WCSCPY
#define USE_AS_STRCAT
-#define STRNCAT WCSCAT
+#define STRNCAT WCSNCAT
#include "strncat-evex.S"

View File

@ -0,0 +1,71 @@
commit 2db79c96baa1256b8fc2656596143da92fabd074
Author: Sergey Kolosov <skolosov@redhat.com>
Date: Wed Apr 10 17:58:04 2024 +0200
libsupport: Add xgetpeername
The patch adds redirections for getpeername.
Reviewed-by: Arjun Shankar <arjun@redhat.com>
(cherry picked from commit 6687a6e3f962759536a8019d31c68c1009ccd6eb)
diff --git a/support/Makefile b/support/Makefile
index 362a51f882787f2b..aa57207bdccc852d 100644
--- a/support/Makefile
+++ b/support/Makefile
@@ -131,6 +131,7 @@ libsupport-routines = \
xfreopen \
xftruncate \
xgetline \
+ xgetpeername \
xgetsockname \
xlisten \
xlseek \
diff --git a/support/xgetpeername.c b/support/xgetpeername.c
new file mode 100644
index 0000000000000000..6f448e456a1d9e1e
--- /dev/null
+++ b/support/xgetpeername.c
@@ -0,0 +1,30 @@
+/* getpeername with error checking.
+ Copyright (C) 2024 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#include <support/xsocket.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <support/check.h>
+
+void
+xgetpeername (int fd, struct sockaddr *sa, socklen_t *plen)
+{
+ if (getpeername (fd, sa, plen) != 0)
+ FAIL_EXIT1 ("getpeername (%d): %m", fd);
+}
diff --git a/support/xsocket.h b/support/xsocket.h
index 3e4410354676cb2a..4ac0e1f5ffe35dc2 100644
--- a/support/xsocket.h
+++ b/support/xsocket.h
@@ -26,6 +26,7 @@
int xsocket (int, int, int);
void xsetsockopt (int, int, int, const void *, socklen_t);
void xgetsockname (int, struct sockaddr *, socklen_t *);
+void xgetpeername (int, struct sockaddr *, socklen_t *);
void xconnect (int, const struct sockaddr *, socklen_t);
void xbind (int, const struct sockaddr *, socklen_t);
void xlisten (int, int);

View File

@ -0,0 +1,143 @@
commit 32969a2b36b8cc74343182b768b3babe6f81c3aa
Author: Sergey Kolosov <skolosov@redhat.com>
Date: Wed Apr 10 17:58:05 2024 +0200
socket: Add new test for connect
This commit adds a simple bind/accept/connect test for an IPv4 TCP
connection to a local process via the loopback interface.
Reviewed-by: Arjun Shankar <arjun@redhat.com>
(cherry picked from commit 3a83f79024cc023a74c3892a1673542e8e972485)
diff --git a/socket/Makefile b/socket/Makefile
index 74ca5b8452cd15d3..fc1bd0a2608f04bc 100644
--- a/socket/Makefile
+++ b/socket/Makefile
@@ -70,6 +70,7 @@ tests := \
tst-accept4 \
tst-cmsg_cloexec \
tst-cmsghdr \
+ tst-connect \
tst-sockopt \
# tests
diff --git a/socket/tst-connect.c b/socket/tst-connect.c
new file mode 100644
index 0000000000000000..ec2fdd92c0a6f1be
--- /dev/null
+++ b/socket/tst-connect.c
@@ -0,0 +1,113 @@
+/* Test the connect function.
+ Copyright (C) 2024 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#include <arpa/inet.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <signal.h>
+#include <stdbool.h>
+#include <support/check.h>
+#include <support/xsocket.h>
+#include <support/xunistd.h>
+#include <sys/socket.h>
+#include <stdio.h>
+
+static struct sockaddr_in server_address;
+
+int
+open_socket_inet_tcp (void)
+{
+ int fd = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP);
+ if (fd < 0)
+ {
+ if (errno == EAFNOSUPPORT)
+ FAIL_UNSUPPORTED ("The host does not support IPv4");
+ else
+ FAIL_EXIT1 ("socket (AF_INET, SOCK_STREAM, IPPROTO_TCP): %m\n");
+ }
+ return fd;
+}
+
+static pid_t
+start_server (void)
+{
+ server_address.sin_family = AF_INET;
+ server_address.sin_port = 0;
+ server_address.sin_addr.s_addr = htonl (INADDR_LOOPBACK);
+
+ int server_sock = open_socket_inet_tcp ();
+
+ xbind (server_sock, (struct sockaddr *) &server_address,
+ sizeof (server_address));
+
+ socklen_t sa_len = sizeof (server_address);
+ xgetsockname (server_sock, (struct sockaddr *) &server_address, &sa_len);
+ xlisten (server_sock, 5);
+
+ pid_t my_pid = xfork ();
+ if (my_pid > 0)
+ {
+ xclose (server_sock);
+ return my_pid;
+ }
+
+ struct sockaddr_in client_address;
+ socklen_t ca_len = sizeof (server_address);
+ int client_sock = xaccept (server_sock, (struct sockaddr *) &client_address,
+ &ca_len);
+ printf ("socket accepted %d\n", client_sock);
+
+ _exit (0);
+}
+
+static int
+do_test (void)
+{
+ pid_t serv_pid;
+ struct sockaddr_in peer;
+ socklen_t peer_len;
+
+ serv_pid = start_server ();
+ int client_sock = open_socket_inet_tcp ();
+ xconnect (client_sock, (const struct sockaddr *) &server_address,
+ sizeof (server_address));
+
+ /* A second connect with same arguments should fail with EISCONN. */
+ int result = connect (client_sock,
+ (const struct sockaddr *) &server_address,
+ sizeof (server_address));
+ if (result == 0 || errno != EISCONN)
+ FAIL_EXIT1 ("Second connect (%d), should fail with EISCONN: %m",
+ client_sock);
+
+ peer_len = sizeof (peer);
+ xgetpeername (client_sock, (struct sockaddr *) &peer, &peer_len);
+ TEST_COMPARE (peer_len, sizeof (peer));
+ TEST_COMPARE (peer.sin_port, server_address.sin_port);
+ TEST_COMPARE_BLOB (&peer.sin_addr, sizeof (peer.sin_addr),
+ &server_address.sin_addr,
+ sizeof (server_address.sin_addr));
+
+ int status;
+ xwaitpid (serv_pid, &status, 0);
+ TEST_COMPARE (status, 0);
+
+ return 0;
+}
+
+#include <support/test-driver.c>

View File

@ -0,0 +1,23 @@
commit c7c3f5bf80ae86b34501f473f1a9fc545c911b7f
Author: caiyinyu <caiyinyu@loongson.cn>
Date: Sat May 11 10:25:54 2024 +0800
LoongArch: Fix undefined `__memset_aligned` reference in ld.so linking.
This patch from 095067efdf68c8061d6f99a21a0300841bede999 (LoongArch: Add
glibc.cpu.hwcap support.)
diff --git a/sysdeps/loongarch/lp64/multiarch/dl-symbol-redir-ifunc.h b/sysdeps/loongarch/lp64/multiarch/dl-symbol-redir-ifunc.h
index cb640d77b7695b93..a73390b12f67a3fc 100644
--- a/sysdeps/loongarch/lp64/multiarch/dl-symbol-redir-ifunc.h
+++ b/sysdeps/loongarch/lp64/multiarch/dl-symbol-redir-ifunc.h
@@ -19,6 +19,9 @@
#ifndef _DL_IFUNC_GENERIC_H
#define _DL_IFUNC_GENERIC_H
+#ifndef SHARED
asm ("memset = __memset_aligned");
+asm ("memcmp = __memcmp_aligned");
+#endif
#endif

View File

@ -0,0 +1,40 @@
commit 9f2b100d6705b9bbb25206b53e80d7759644e06e
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Sat May 25 05:13:41 2024 -0700
parse_fdinfo: Don't advance pointer twice [BZ #31798]
pidfd_getpid.c has
/* Ignore invalid large values. */
if (INT_MULTIPLY_WRAPV (10, n, &n)
|| INT_ADD_WRAPV (n, *l++ - '0', &n))
return -1;
For GCC older than GCC 7, INT_ADD_WRAPV(a, b, r) is defined as
_GL_INT_OP_WRAPV (a, b, r, +, _GL_INT_ADD_RANGE_OVERFLOW)
and *l++ - '0' is evaluated twice. Fix BZ #31798 by moving "l++" out of
the if statement. Tested with GCC 6.4 and GCC 14.1.
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
(cherry picked from commit f981bf6b9db87e0732b46bfe92fdad4d363225e8)
diff --git a/sysdeps/unix/sysv/linux/pidfd_getpid.c b/sysdeps/unix/sysv/linux/pidfd_getpid.c
index 8567b413dd2c210b..30025e5863f7b956 100644
--- a/sysdeps/unix/sysv/linux/pidfd_getpid.c
+++ b/sysdeps/unix/sysv/linux/pidfd_getpid.c
@@ -74,8 +74,10 @@ parse_fdinfo (const char *l, void *arg)
/* Ignore invalid large values. */
if (INT_MULTIPLY_WRAPV (10, n, &n)
- || INT_ADD_WRAPV (n, *l++ - '0', &n))
+ || INT_ADD_WRAPV (n, *l - '0', &n))
return -1;
+
+ l++;
}
/* -1 indicates that the process is terminated. */

View File

@ -0,0 +1,195 @@
commit 26e7005728f0eea2972474e6be2905c467661237
Author: Florian Weimer <fweimer@redhat.com>
Date: Sat May 18 09:33:19 2024 +0200
socket: Use may_alias on sockaddr structs (bug 19622)
This supports common coding patterns. The GCC C front end before
version 7 rejects the may_alias attribute on a struct definition
if it was not present in a previous forward declaration, so this
attribute can only be conditionally applied.
This implements the spirit of the change in Austin Group issue 1641.
Suggested-by: Marek Polacek <polacek@redhat.com>
Suggested-by: Jakub Jelinek <jakub@redhat.com>
Reviewed-by: Sam James <sam@gentoo.org>
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
(cherry picked from commit 8d7b6b4cb27d4dec1dd5f7960298c1699275f962)
diff --git a/bits/socket.h b/bits/socket.h
index 13de124bac67c217..772074d52ab957df 100644
--- a/bits/socket.h
+++ b/bits/socket.h
@@ -149,7 +149,7 @@ enum __socket_type
#include <bits/sockaddr.h>
/* Structure describing a generic socket address. */
-struct sockaddr
+struct __attribute_struct_may_alias__ sockaddr
{
__SOCKADDR_COMMON (sa_); /* Common data: address family and length. */
char sa_data[14]; /* Address data. */
@@ -166,7 +166,7 @@ struct sockaddr
#define _SS_PADSIZE \
(_SS_SIZE - __SOCKADDR_COMMON_SIZE - sizeof (__ss_aligntype))
-struct sockaddr_storage
+struct __attribute_struct_may_alias__ sockaddr_storage
{
__SOCKADDR_COMMON (ss_); /* Address family, etc. */
char __ss_padding[_SS_PADSIZE];
diff --git a/inet/netinet/in.h b/inet/netinet/in.h
index fa57b6107908590c..f684be5beb26fc62 100644
--- a/inet/netinet/in.h
+++ b/inet/netinet/in.h
@@ -244,7 +244,7 @@ extern const struct in6_addr in6addr_loopback; /* ::1 */
/* Structure describing an Internet socket address. */
-struct sockaddr_in
+struct __attribute_struct_may_alias__ sockaddr_in
{
__SOCKADDR_COMMON (sin_);
in_port_t sin_port; /* Port number. */
@@ -257,9 +257,11 @@ struct sockaddr_in
- sizeof (struct in_addr)];
};
-#if !__USE_KERNEL_IPV6_DEFS
+#if __USE_KERNEL_IPV6_DEFS
+struct __attribute_struct_may_alias__ sockaddr_in6;
+#else
/* Ditto, for IPv6. */
-struct sockaddr_in6
+struct __attribute_struct_may_alias__ sockaddr_in6
{
__SOCKADDR_COMMON (sin6_);
in_port_t sin6_port; /* Transport layer port # */
diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h
index 520231dbea3a4e24..399ee7d24cae9446 100644
--- a/misc/sys/cdefs.h
+++ b/misc/sys/cdefs.h
@@ -720,4 +720,13 @@ _Static_assert (0, "IEEE 128-bits long double requires redirection on this platf
# define __attribute_returns_twice__ /* Ignore. */
#endif
+/* Mark struct types as aliasable. Restricted to compilers that
+ support forward declarations of structs in the presence of the
+ attribute. */
+#if __GNUC_PREREQ (7, 1) || defined __clang__
+# define __attribute_struct_may_alias__ __attribute__ ((__may_alias__))
+#else
+# define __attribute_struct_may_alias__
+#endif
+
#endif /* sys/cdefs.h */
diff --git a/socket/sys/un.h b/socket/sys/un.h
index bf03b7d6ce959065..ff9cbd6efa7693d5 100644
--- a/socket/sys/un.h
+++ b/socket/sys/un.h
@@ -26,7 +26,7 @@
__BEGIN_DECLS
/* Structure describing the address of an AF_LOCAL (aka AF_UNIX) socket. */
-struct sockaddr_un
+struct __attribute_struct_may_alias__ sockaddr_un
{
__SOCKADDR_COMMON (sun_);
char sun_path[108]; /* Path name. */
diff --git a/sysdeps/mach/hurd/bits/socket.h b/sysdeps/mach/hurd/bits/socket.h
index 3e72f9fa93add888..b5eeac373111e694 100644
--- a/sysdeps/mach/hurd/bits/socket.h
+++ b/sysdeps/mach/hurd/bits/socket.h
@@ -153,7 +153,7 @@ enum __socket_type
#include <bits/sockaddr.h>
/* Structure describing a generic socket address. */
-struct sockaddr
+struct __attribute_struct_may_alias__ sockaddr
{
__SOCKADDR_COMMON (sa_); /* Common data: address family and length. */
char sa_data[14]; /* Address data. */
@@ -170,7 +170,7 @@ struct sockaddr
#define _SS_PADSIZE \
(_SS_SIZE - __SOCKADDR_COMMON_SIZE - sizeof (__ss_aligntype))
-struct sockaddr_storage
+struct __attribute_struct_may_alias__ sockaddr_storage
{
__SOCKADDR_COMMON (ss_); /* Address family, etc. */
char __ss_padding[_SS_PADSIZE];
diff --git a/sysdeps/unix/sysv/linux/bits/socket.h b/sysdeps/unix/sysv/linux/bits/socket.h
index 0d86feb4cadc13e3..6dab283a2ebeaed1 100644
--- a/sysdeps/unix/sysv/linux/bits/socket.h
+++ b/sysdeps/unix/sysv/linux/bits/socket.h
@@ -180,7 +180,7 @@ typedef __socklen_t socklen_t;
#include <bits/sockaddr.h>
/* Structure describing a generic socket address. */
-struct sockaddr
+struct __attribute_struct_may_alias__ sockaddr
{
__SOCKADDR_COMMON (sa_); /* Common data: address family and length. */
char sa_data[14]; /* Address data. */
@@ -193,7 +193,7 @@ struct sockaddr
#define _SS_PADSIZE \
(_SS_SIZE - __SOCKADDR_COMMON_SIZE - sizeof (__ss_aligntype))
-struct sockaddr_storage
+struct __attribute_struct_may_alias__ sockaddr_storage
{
__SOCKADDR_COMMON (ss_); /* Address family, etc. */
char __ss_padding[_SS_PADSIZE];
diff --git a/sysdeps/unix/sysv/linux/net/if_packet.h b/sysdeps/unix/sysv/linux/net/if_packet.h
index 9ffb69b508cc8ca7..c17e1c23c5cf9169 100644
--- a/sysdeps/unix/sysv/linux/net/if_packet.h
+++ b/sysdeps/unix/sysv/linux/net/if_packet.h
@@ -26,7 +26,7 @@
From Linux 2.1 the AF_PACKET interface is preferred and you should
consider using it in place of this one. */
-struct sockaddr_pkt
+struct __attribute_struct_may_alias__ sockaddr_pkt
{
__SOCKADDR_COMMON (spkt_);
unsigned char spkt_device[14];
diff --git a/sysdeps/unix/sysv/linux/netash/ash.h b/sysdeps/unix/sysv/linux/netash/ash.h
index 7d885d17cc9ec313..7a6ff50b17b370c4 100644
--- a/sysdeps/unix/sysv/linux/netash/ash.h
+++ b/sysdeps/unix/sysv/linux/netash/ash.h
@@ -22,7 +22,7 @@
#include <features.h>
#include <bits/sockaddr.h>
-struct sockaddr_ash
+struct __attribute_struct_may_alias__ sockaddr_ash
{
__SOCKADDR_COMMON (sash_); /* Common data: address family etc. */
int sash_ifindex; /* Interface to use. */
diff --git a/sysdeps/unix/sysv/linux/neteconet/ec.h b/sysdeps/unix/sysv/linux/neteconet/ec.h
index b07a10796196e28e..f3132f06ff9f8dee 100644
--- a/sysdeps/unix/sysv/linux/neteconet/ec.h
+++ b/sysdeps/unix/sysv/linux/neteconet/ec.h
@@ -28,7 +28,7 @@ struct ec_addr
unsigned char net; /* Network number. */
};
-struct sockaddr_ec
+struct __attribute_struct_may_alias__ sockaddr_ec
{
__SOCKADDR_COMMON (sec_);
unsigned char port; /* Port number. */
diff --git a/sysdeps/unix/sysv/linux/netiucv/iucv.h b/sysdeps/unix/sysv/linux/netiucv/iucv.h
index f5fad817513f3c46..27151e8bbe1e7fa2 100644
--- a/sysdeps/unix/sysv/linux/netiucv/iucv.h
+++ b/sysdeps/unix/sysv/linux/netiucv/iucv.h
@@ -23,7 +23,7 @@
__BEGIN_DECLS
-struct sockaddr_iucv
+struct __attribute_struct_may_alias__ sockaddr_iucv
{
__SOCKADDR_COMMON (siucv_);
unsigned short siucv_port; /* Reserved */

1824
glibc-upstream-2.39-61.patch Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,38 @@
commit aee37de299af95007a1f00f2cdf6c1452f39e682
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Fri Apr 5 09:02:36 2024 -0300
Reinstate generic features-time64.h
The a4ed0471d7 removed the generic version which is included by
features.h and used by Hurd.
Checked by building i686-gnu and x86_64-gnu with build-many-glibc.py.
(cherry picked from commit c27f8763cffbb7db9b3f1f5e09ef24d26cbb63f4)
diff --git a/sysdeps/generic/features-time64.h b/sysdeps/generic/features-time64.h
new file mode 100644
index 0000000000000000..4d38b8ba766b34f5
--- /dev/null
+++ b/sysdeps/generic/features-time64.h
@@ -0,0 +1,19 @@
+/* Features part to handle 64-bit time_t support. Generic version.
+ Copyright (C) 2021-2024 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+/* The generic configuration only support _TIME_BITS=32. */

View File

@ -0,0 +1,62 @@
commit c9d8534406ab69b9bc1fd3fdfb9e88c9580d3f24
Author: Sunil K Pandey <skpgkp2@gmail.com>
Date: Mon May 27 10:08:18 2024 -0700
i386: Disable Intel Xeon Phi tests for GCC 15 and above (BZ 31782)
This patch disables Intel Xeon Phi tests for GCC 15 and above.
GCC 15 removed Intel Xeon Phi ISA support.
commit e1a7e2c54d52d0ba374735e285b617af44841ace
Author: Haochen Jiang <haochen.jiang@intel.com>
Date: Mon May 20 10:43:44 2024 +0800
i386: Remove Xeon Phi ISA support
Fixes BZ 31782.
Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
(cherry picked from commit 1b713c9a5349ef3cd1a8ccf9de017c7865713c67)
diff --git a/sysdeps/x86/tst-cpu-features-supports.c b/sysdeps/x86/tst-cpu-features-supports.c
index 93008dac703e762f..0f43ef2b2da0d3db 100644
--- a/sysdeps/x86/tst-cpu-features-supports.c
+++ b/sysdeps/x86/tst-cpu-features-supports.c
@@ -65,7 +65,7 @@ do_test (int argc, char **argv)
#endif
fails += CHECK_FEATURE_ACTIVE (avx, AVX);
fails += CHECK_FEATURE_ACTIVE (avx2, AVX2);
-#if __GNUC_PREREQ (7, 0)
+#if __GNUC_PREREQ (7, 0) && !__GNUC_PREREQ (15, 0)
fails += CHECK_FEATURE_ACTIVE (avx5124fmaps, AVX512_4FMAPS);
fails += CHECK_FEATURE_ACTIVE (avx5124vnniw, AVX512_4VNNIW);
#endif
@@ -92,14 +92,18 @@ do_test (int argc, char **argv)
#if __GNUC_PREREQ (6, 0)
fails += CHECK_FEATURE_ACTIVE (avx512bw, AVX512BW);
fails += CHECK_FEATURE_ACTIVE (avx512cd, AVX512CD);
+# if !__GNUC_PREREQ (15, 0)
fails += CHECK_FEATURE_ACTIVE (avx512er, AVX512ER);
+# endif
fails += CHECK_FEATURE_ACTIVE (avx512dq, AVX512DQ);
#endif
#if __GNUC_PREREQ (5, 0)
fails += CHECK_FEATURE_ACTIVE (avx512f, AVX512F);
#endif
#if __GNUC_PREREQ (6, 0)
+# if !__GNUC_PREREQ (15, 0)
fails += CHECK_FEATURE_ACTIVE (avx512pf, AVX512PF);
+# endif
fails += CHECK_FEATURE_ACTIVE (avx512vl, AVX512VL);
#endif
#if __GNUC_PREREQ (5, 0)
@@ -148,7 +152,9 @@ do_test (int argc, char **argv)
#endif
fails += CHECK_FEATURE_ACTIVE (popcnt, POPCNT);
#if __GNUC_PREREQ (11, 0)
+# if !__GNUC_PREREQ (15, 0)
fails += CHECK_FEATURE_ACTIVE (prefetchwt1, PREFETCHWT1);
+# endif
fails += CHECK_FEATURE_ACTIVE (ptwrite, PTWRITE);
fails += CHECK_FEATURE_ACTIVE (rdpid, RDPID);
fails += CHECK_FEATURE_ACTIVE (rdrnd, RDRAND);

View File

@ -0,0 +1,68 @@
commit 70f560fc22212f733647c9121c26bbb2307f2e10
Author: Stafford Horne <shorne@gmail.com>
Date: Wed Apr 3 06:40:37 2024 +0100
misc: Add support for Linux uio.h RWF_NOAPPEND flag
In Linux 6.9 a new flag is added to allow for Per-io operations to
disable append mode even if a file was opened with the flag O_APPEND.
This is done with the new RWF_NOAPPEND flag.
This caused two test failures as these tests expected the flag 0x00000020
to be unused. Adding the flag definition now fixes these tests on Linux
6.9 (v6.9-rc1).
FAIL: misc/tst-preadvwritev2
FAIL: misc/tst-preadvwritev64v2
This patch adds the flag, adjusts the test and adds details to
documentation.
Link: https://lore.kernel.org/all/20200831153207.GO3265@brightrain.aerifal.cx/
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
(cherry picked from commit 3db9d208dd5f30b12900989c6d2214782b8e2011)
diff --git a/manual/llio.texi b/manual/llio.texi
index 0b61d491f50b763a..fae49d14332db675 100644
--- a/manual/llio.texi
+++ b/manual/llio.texi
@@ -1339,6 +1339,10 @@ will fail and set @code{errno} to @code{EAGAIN} if the operation would block.
@item RWF_APPEND
Per-IO synchronization as if the file was opened with @code{O_APPEND} flag.
+
+@item RWF_NOAPPEND
+This flag allows an offset to be honored, even if the file was opened with
+@code{O_APPEND} flag.
@end vtable
When the source file is compiled with @code{_FILE_OFFSET_BITS == 64} the
diff --git a/misc/tst-preadvwritev2-common.c b/misc/tst-preadvwritev2-common.c
index b5f19f002cd1653e..8e04ff7282e727b6 100644
--- a/misc/tst-preadvwritev2-common.c
+++ b/misc/tst-preadvwritev2-common.c
@@ -34,8 +34,11 @@
#ifndef RWF_APPEND
# define RWF_APPEND 0
#endif
+#ifndef RWF_NOAPPEND
+# define RWF_NOAPPEND 0
+#endif
#define RWF_SUPPORTED (RWF_HIPRI | RWF_DSYNC | RWF_SYNC | RWF_NOWAIT \
- | RWF_APPEND)
+ | RWF_APPEND | RWF_NOAPPEND)
/* Generic uio_lim.h does not define IOV_MAX. */
#ifndef IOV_MAX
diff --git a/sysdeps/unix/sysv/linux/bits/uio-ext.h b/sysdeps/unix/sysv/linux/bits/uio-ext.h
index 7854cccef3e0a618..ead7a091566aa295 100644
--- a/sysdeps/unix/sysv/linux/bits/uio-ext.h
+++ b/sysdeps/unix/sysv/linux/bits/uio-ext.h
@@ -47,6 +47,7 @@ extern ssize_t process_vm_writev (pid_t __pid, const struct iovec *__lvec,
#define RWF_SYNC 0x00000004 /* per-IO O_SYNC. */
#define RWF_NOWAIT 0x00000008 /* per-IO nonblocking mode. */
#define RWF_APPEND 0x00000010 /* per-IO O_APPEND. */
+#define RWF_NOAPPEND 0x00000020 /* per-IO negation of O_APPEND */
__END_DECLS

View File

@ -0,0 +1,44 @@
commit 6ade91c21140d8c803c289932dbfc74537f65a1f
Author: Florian Weimer <fweimer@redhat.com>
Date: Mon Jun 3 10:49:40 2024 +0200
elf: Avoid some free (NULL) calls in _dl_update_slotinfo
This has been confirmed to work around some interposed mallocs. Here
is a discussion of the impact test ust/libc-wrapper/test_libc-wrapper
in lttng-tools:
New TLS usage in libgcc_s.so.1, compatibility impact
<https://inbox.sourceware.org/libc-alpha/8734v1ieke.fsf@oldenburg.str.redhat.com/>
Reportedly, this patch also papers over a similar issue when tcmalloc
2.9.1 is not compiled with -ftls-model=initial-exec. Of course the
goal really should be to compile mallocs with the initial-exec TLS
model, but this commit appears to be a useful interim workaround.
Fixes commit d2123d68275acc0f061e73d5f86ca504e0d5a344 ("elf: Fix slow
tls access after dlopen [BZ #19924]").
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
(cherry picked from commit afe42e935b3ee97bac9a7064157587777259c60e)
diff --git a/elf/dl-tls.c b/elf/dl-tls.c
index 7b3dd9ab60e89ae9..670dbc42fc2e3334 100644
--- a/elf/dl-tls.c
+++ b/elf/dl-tls.c
@@ -819,7 +819,14 @@ _dl_update_slotinfo (unsigned long int req_modid, size_t new_gen)
dtv entry free it. Note: this is not AS-safe. */
/* XXX Ideally we will at some point create a memory
pool. */
- free (dtv[modid].pointer.to_free);
+ /* Avoid calling free on a null pointer. Some mallocs
+ incorrectly use dynamic TLS, and depending on how the
+ free function was compiled, it could call
+ __tls_get_addr before the null pointer check in the
+ free implementation. Checking here papers over at
+ least some dynamic TLS usage by interposed mallocs. */
+ if (dtv[modid].pointer.to_free != NULL)
+ free (dtv[modid].pointer.to_free);
dtv[modid].pointer.val = TLS_DTV_UNALLOCATED;
dtv[modid].pointer.to_free = NULL;

View File

@ -170,7 +170,7 @@ Version: %{glibcversion}
# - It allows using the Release number without the %%dist tag in the dependency
# generator to make the generated requires interchangeable between Rawhide
# and ELN (.elnYY < .fcXX).
%global baserelease 14
%global baserelease 15
Release: %{baserelease}%{?dist}
# Licenses:
@ -386,6 +386,17 @@ Patch75: glibc-upstream-2.39-52.patch
Patch76: glibc-upstream-2.39-53.patch
Patch77: glibc-upstream-2.39-54.patch
Patch78: glibc-RHEL-22226.patch
Patch79: glibc-upstream-2.39-55.patch
Patch80: glibc-upstream-2.39-56.patch
Patch81: glibc-upstream-2.39-57.patch
Patch82: glibc-upstream-2.39-58.patch
Patch83: glibc-upstream-2.39-59.patch
Patch84: glibc-upstream-2.39-60.patch
Patch85: glibc-upstream-2.39-61.patch
Patch86: glibc-upstream-2.39-62.patch
Patch87: glibc-upstream-2.39-63.patch
Patch88: glibc-upstream-2.39-64.patch
Patch89: glibc-upstream-2.39-65.patch
##############################################################################
# Continued list of core "glibc" package information:
@ -2611,6 +2622,21 @@ update_gconv_modules_cache ()
%endif
%changelog
* Wed Jun 05 2024 Arjun Shankar <arjun@redhat.com> - 2.39-15
- Sync with upstream branch release/2.39/master,
commit 6ade91c21140d8c803c289932dbfc74537f65a1f:
- elf: Avoid some free (NULL) calls in _dl_update_slotinfo
- misc: Add support for Linux uio.h RWF_NOAPPEND flag
- i386: Disable Intel Xeon Phi tests for GCC 15 and above (BZ 31782)
- Reinstate generic features-time64.h
- Always define __USE_TIME_BITS64 when 64 bit time_t is used
- socket: Use may_alias on sockaddr structs (bug 19622)
- parse_fdinfo: Don't advance pointer twice [BZ #31798]
- LoongArch: Fix undefined `__memset_aligned` reference in ld.so linking.
- socket: Add new test for connect
- libsupport: Add xgetpeername
- x86_64: Fix missing wcsncat function definition without multiarch (x86-64-v4)
* Fri May 31 2024 Florian Weimer <fweimer@redhat.com> - 2.39-14
- Enable CPU compatibility diagnostics in ld.so (#2276631, RHEL-31738)