diff --git a/SOURCES/glibc-rh1642150-4.patch b/SOURCES/glibc-rh1642150-4.patch new file mode 100644 index 0000000..b4d53e5 --- /dev/null +++ b/SOURCES/glibc-rh1642150-4.patch @@ -0,0 +1,36 @@ +commit e627106266ad8785457fadbf5bf67ed604d2a353 +Author: Florian Weimer +Date: Mon May 11 11:20:02 2020 +0200 + + POWER: Add context-synchronizing instructions to pkey_write [BZ #25954] + + Sandipan Das reported that, + + "The Power ISA mandates that all writes to the Authority + Mask Register (AMR) must always be preceded as well as + succeeded by a context-synchronizing instruction. This + applies to both the privileged and unprivileged variants + of the Move To AMR instruction. + + This [requirement] is from Table 6 of Chapter 11 in page 1134 of Power + ISA 3.0B. The document can be found here: + + " + + See this kernel patch submission: + + + +diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/arch-pkey.h b/sysdeps/unix/sysv/linux/powerpc/powerpc64/arch-pkey.h +index 623b073d5a585d51..25d080c9a6f30942 100644 +--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/arch-pkey.h ++++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/arch-pkey.h +@@ -37,7 +37,7 @@ pkey_read (void) + static inline void + pkey_write (unsigned long int value) + { +- __asm__ volatile ("mtspr 13, %0" : : "r" (value)); ++ __asm__ volatile ("isync; mtspr 13, %0; isync" : : "r" (value)); + } + + /* Number of the largest supported key. This depends on the width of diff --git a/SOURCES/glibc-rh1836867.patch b/SOURCES/glibc-rh1836867.patch new file mode 100644 index 0000000..d546a44 --- /dev/null +++ b/SOURCES/glibc-rh1836867.patch @@ -0,0 +1,194 @@ +commit 790b8dda4455865cb8c3a47801f4304c1a43baf6 +Author: Florian Weimer +Date: Tue May 19 14:09:38 2020 +0200 + + nss_compat: internal_end*ent may clobber errno, hiding ERANGE [BZ #25976] + + During cleanup, before returning from get*_r functions, the end*ent + calls must not change errno. Otherwise, an ERANGE error from the + underlying implementation can be hidden, causing unexpected lookup + failures. This commit introduces an internal_end*ent_noerror + function which saves and restore errno, and marks the original + internal_end*ent function as warn_unused_result, so that it is used + only in contexts were errors from it can be handled explicitly. + + Reviewed-by: DJ Delorie + +diff --git a/nss/nss_compat/compat-grp.c b/nss/nss_compat/compat-grp.c +index 012929eae7048702..fca9f4860f72e3d2 100644 +--- a/nss/nss_compat/compat-grp.c ++++ b/nss/nss_compat/compat-grp.c +@@ -142,7 +142,7 @@ _nss_compat_setgrent (int stayopen) + } + + +-static enum nss_status ++static enum nss_status __attribute_warn_unused_result__ + internal_endgrent (ent_t *ent) + { + if (ent->stream != NULL) +@@ -163,6 +163,15 @@ internal_endgrent (ent_t *ent) + return NSS_STATUS_SUCCESS; + } + ++/* Like internal_endgrent, but preserve errno in all cases. */ ++static void ++internal_endgrent_noerror (ent_t *ent) ++{ ++ int saved_errno = errno; ++ enum nss_status unused __attribute__ ((unused)) = internal_endgrent (ent); ++ __set_errno (saved_errno); ++} ++ + enum nss_status + _nss_compat_endgrent (void) + { +@@ -483,7 +492,7 @@ _nss_compat_getgrnam_r (const char *name, struct group *grp, + if (result == NSS_STATUS_SUCCESS) + result = internal_getgrnam_r (name, grp, &ent, buffer, buflen, errnop); + +- internal_endgrent (&ent); ++ internal_endgrent_noerror (&ent); + + return result; + } +@@ -612,7 +621,7 @@ _nss_compat_getgrgid_r (gid_t gid, struct group *grp, + if (result == NSS_STATUS_SUCCESS) + result = internal_getgrgid_r (gid, grp, &ent, buffer, buflen, errnop); + +- internal_endgrent (&ent); ++ internal_endgrent_noerror (&ent); + + return result; + } +diff --git a/nss/nss_compat/compat-initgroups.c b/nss/nss_compat/compat-initgroups.c +index 5beaa6b88b7e1764..d7a89ea8e7718ab0 100644 +--- a/nss/nss_compat/compat-initgroups.c ++++ b/nss/nss_compat/compat-initgroups.c +@@ -133,7 +133,7 @@ internal_setgrent (ent_t *ent) + } + + +-static enum nss_status ++static enum nss_status __attribute_warn_unused_result__ + internal_endgrent (ent_t *ent) + { + if (ent->stream != NULL) +@@ -157,6 +157,15 @@ internal_endgrent (ent_t *ent) + return NSS_STATUS_SUCCESS; + } + ++/* Like internal_endgrent, but preserve errno in all cases. */ ++static void ++internal_endgrent_noerror (ent_t *ent) ++{ ++ int saved_errno = errno; ++ enum nss_status unused __attribute__ ((unused)) = internal_endgrent (ent); ++ __set_errno (saved_errno); ++} ++ + /* Add new group record. */ + static void + add_group (long int *start, long int *size, gid_t **groupsp, long int limit, +@@ -501,7 +510,7 @@ _nss_compat_initgroups_dyn (const char *user, gid_t group, long int *start, + done: + scratch_buffer_free (&tmpbuf); + +- internal_endgrent (&intern); ++ internal_endgrent_noerror (&intern); + + return status; + } +diff --git a/nss/nss_compat/compat-pwd.c b/nss/nss_compat/compat-pwd.c +index a903452cdf96de74..8832fb7518d8bbff 100644 +--- a/nss/nss_compat/compat-pwd.c ++++ b/nss/nss_compat/compat-pwd.c +@@ -259,7 +259,7 @@ _nss_compat_setpwent (int stayopen) + } + + +-static enum nss_status ++static enum nss_status __attribute_warn_unused_result__ + internal_endpwent (ent_t *ent) + { + if (ent->stream != NULL) +@@ -287,6 +287,15 @@ internal_endpwent (ent_t *ent) + return NSS_STATUS_SUCCESS; + } + ++/* Like internal_endpwent, but preserve errno in all cases. */ ++static void ++internal_endpwent_noerror (ent_t *ent) ++{ ++ int saved_errno = errno; ++ enum nss_status unused __attribute__ ((unused)) = internal_endpwent (ent); ++ __set_errno (saved_errno); ++} ++ + enum nss_status + _nss_compat_endpwent (void) + { +@@ -822,7 +831,7 @@ _nss_compat_getpwnam_r (const char *name, struct passwd *pwd, + if (result == NSS_STATUS_SUCCESS) + result = internal_getpwnam_r (name, pwd, &ent, buffer, buflen, errnop); + +- internal_endpwent (&ent); ++ internal_endpwent_noerror (&ent); + + return result; + } +@@ -1061,7 +1070,7 @@ _nss_compat_getpwuid_r (uid_t uid, struct passwd *pwd, + if (result == NSS_STATUS_SUCCESS) + result = internal_getpwuid_r (uid, pwd, &ent, buffer, buflen, errnop); + +- internal_endpwent (&ent); ++ internal_endpwent_noerror (&ent); + + return result; + } +diff --git a/nss/nss_compat/compat-spwd.c b/nss/nss_compat/compat-spwd.c +index eb96ca09172d5743..684a06007ab84ac9 100644 +--- a/nss/nss_compat/compat-spwd.c ++++ b/nss/nss_compat/compat-spwd.c +@@ -215,7 +215,7 @@ _nss_compat_setspent (int stayopen) + } + + +-static enum nss_status ++static enum nss_status __attribute_warn_unused_result__ + internal_endspent (ent_t *ent) + { + if (ent->stream != NULL) +@@ -244,6 +244,15 @@ internal_endspent (ent_t *ent) + return NSS_STATUS_SUCCESS; + } + ++/* Like internal_endspent, but preserve errno in all cases. */ ++static void ++internal_endspent_noerror (ent_t *ent) ++{ ++ int saved_errno = errno; ++ enum nss_status unused __attribute__ ((unused)) = internal_endspent (ent); ++ __set_errno (saved_errno); ++} ++ + enum nss_status + _nss_compat_endspent (void) + { +@@ -261,7 +270,6 @@ _nss_compat_endspent (void) + return result; + } + +- + static enum nss_status + getspent_next_nss_netgr (const char *name, struct spwd *result, ent_t *ent, + char *group, char *buffer, size_t buflen, +@@ -786,7 +794,7 @@ _nss_compat_getspnam_r (const char *name, struct spwd *pwd, + if (result == NSS_STATUS_SUCCESS) + result = internal_getspnam_r (name, pwd, &ent, buffer, buflen, errnop); + +- internal_endspent (&ent); ++ internal_endspent_noerror (&ent); + + return result; + } diff --git a/SPECS/glibc.spec b/SPECS/glibc.spec index a4791e9..f2da64a 100644 --- a/SPECS/glibc.spec +++ b/SPECS/glibc.spec @@ -1,6 +1,6 @@ %define glibcsrcdir glibc-2.28 %define glibcversion 2.28 -%define glibcrelease 123%{?dist} +%define glibcrelease 126%{?dist} # Pre-release tarballs are pulled in from git using a command that is # effectively: # @@ -482,6 +482,8 @@ Patch348: glibc-rh1748197-4.patch Patch349: glibc-rh1748197-5.patch Patch350: glibc-rh1748197-6.patch Patch351: glibc-rh1748197-7.patch +Patch352: glibc-rh1642150-4.patch +Patch353: glibc-rh1836867.patch ############################################################################## # Continued list of core "glibc" package information: @@ -1372,8 +1374,7 @@ pushd %{glibc_sysroot}%{_prefix}/lib/locale rm -f locale-archive # Intentionally we do not pass --alias-file=, aliases will be added # by build-locale-archive. -$olddir/build-%{target}/elf/ld.so \ - --library-path $olddir/build-%{target}/ \ +$olddir/build-%{target}/testrun.sh \ $olddir/build-%{target}/locale/localedef \ --prefix %{glibc_sysroot} --add-to-archive \ eo *_* @@ -2381,6 +2382,15 @@ fi %files -f compat-libpthread-nonshared.filelist -n compat-libpthread-nonshared %changelog +* Wed May 27 2020 Florian Weimer - 2.28-126 +- Do not clobber errno in nss_compat (#1836867) + +* Thu May 14 2020 Carlos O'Donell - 2.28-125 +- Support building rpm under newer versions of Coverity Scan (#1835999) + +* Mon May 11 2020 Florian Weimer - 2.28-124 +- Enhance memory protection key support on ppc64le (#1642150) + * Thu Apr 23 2020 Florian Weimer - 2.28-123 - Reduce IFUNC resolver usage in libpthread and librt (#1748197)