Skip to content
Commits on Source (21)
......@@ -44,6 +44,60 @@ glibc (2.30-0experimental0) UNRELEASED; urgency=medium
 
-- Adam Conrad <adconrad@0c3.net> Thu, 29 Aug 2019 01:58:14 -0600
 
glibc (2.29-5) unstable; urgency=medium
* Upload to unstable.
-- Aurelien Jarno <aurel32@debian.org> Fri, 06 Dec 2019 21:33:17 +0100
glibc (2.29-4) experimental; urgency=medium
[ Aurelien Jarno ]
* Upload to experimental.
* debian/control.in/libc: make libc depends on libcrypt1, libc-dev depends
on libcrypt1-dev and libc-udeb depends on libcrypt1-udeb. Closes:
#941853.
* debian/rules, debian/rules.d/build.mk, debian/rules.d/debhelper.mk,
debian/sysdeps/amd64.mk: disable libcrypt by passing --disable-crypt
except for bi/triarch builds.
-- Aurelien Jarno <aurel32@debian.org> Mon, 25 Nov 2019 22:36:50 +0100
glibc (2.29-3) unstable; urgency=medium
[ Svante Signell ]
* patches/hurd-i386/git-rlock.diff: New patch to add support for record
locking.
[ Samuel Thibault ]
* patches/hurd-i386/tg-locarchive.diff,tg-WRLCK-upgrade.diff: Remove, now
useless.
* control: Bump hurd-dev dependency to get record locking RPC.
* libc0.3.symbols.hurd-i386: Update accordingly.
* patches/arm/unsubmitted-ldso-abi-check.diff: Remove obsolete patch.
Closes: #943798.
-- Samuel Thibault <sthibault@debian.org> Thu, 31 Oct 2019 23:31:12 +0100
glibc (2.29-2) unstable; urgency=medium
[ Aurelien Jarno ]
* debian/control.in/main: drop the <!nocheck> profile from the
python3:native build-depends. Closes: #939871.
* debian/patches/git-updates.diff: update from upstream stable branch:
- Fix getegid, geteuid and getppid on alpha with < 5.1 kernels.
Closes: #939898.
[ Sven Joachim ]
* debian/script.in/nsscheck.sh: Do not restart services of different
architecture than libc. Closes: #700472.
[ Samuel Thibault ]
* patches/hurd-i386/submitted-anon-mmap-shared.diff: Re-disable, actually
makes some tests fail.
-- Aurelien Jarno <aurel32@debian.org> Fri, 20 Sep 2019 21:39:03 +0200
glibc (2.29-1) unstable; urgency=medium
 
[ Aurelien Jarno ]
......@@ -658,7 +712,7 @@ glibc (2.27-3) unstable; urgency=medium
glibc (2.27-2) unstable; urgency=medium
 
[ Samuel Thibault ]
* debian/patches/hurd-i386/git-UTIME.diff: New patch.
* debian/patches/hurd-i386/git-UTIME.diff: New patch. Closes: #762677.
* debian/control: Bump hurd build dep accordingly.
* debian/libc0.3.symbols.hurd-i386: Update accordingly.
 
......
......@@ -6,12 +6,12 @@ Build-Depends: gettext, dpkg (>= 1.18.7), dpkg-dev (>= 1.17.14), xz-utils, file,
linux-libc-dev (>= 3.9) [linux-any],
libaudit-dev [linux-any], libcap-dev [linux-any], libselinux-dev [linux-any],
mig (>= 1.5-3) [hurd-i386], gnumach-dev (>= 2:1.8+git20181103-1~) [hurd-i386],
hurd-dev (>= 1:0.9.git20181030-1) [hurd-i386] | hurd-headers-dev [hurd-i386],
hurd-dev (>= 1:0.9.git20181030-1) [hurd-i386] <!stage1> | libihash-dev [hurd-i386] <!stage1>,
hurd-dev (>= 1:0.9.git20191029-1) [hurd-i386] | hurd-headers-dev [hurd-i386],
hurd-dev (>= 1:0.9.git20191029-1) [hurd-i386] <!stage1> | libihash-dev [hurd-i386] <!stage1>,
kfreebsd-kernel-headers [kfreebsd-any],
binutils (>= 2.29),
g++-9, g++-9-multilib [amd64 i386 kfreebsd-amd64 mips mipsel mipsn32 mipsn32el mips64 mips64el mipsr6 mipsr6el mipsn32r6 mipsn32r6el mips64r6 mips64r6el powerpc ppc64 s390x sparc sparc64 x32] <!nobiarch>,
python3:native <!nocheck>,
python3:native,
libidn2-0 (>= 2.0.5~) <!nocheck>,
libc-bin (>= 2.30) <cross>
Build-Depends-Indep: perl, po-debconf (>= 1.0)
......@@ -144,7 +144,7 @@ Architecture: amd64 arm64 armel armhf hppa i386 m68k mips mipsel mipsn32 mipsn32
Section: libs
Priority: optional
Multi-Arch: same
Depends: ${shlibs:Depends}, ${libgcc:Depends}
Depends: ${shlibs:Depends}, ${libgcc:Depends}, libcrypt1
Recommends: libidn2-0 (>= 2.0.5~)
Suggests: glibc-doc, debconf | debconf-2.0, libc-l10n, locales [!hurd-i386]
Provides: libc6-sparcv9b [sparc sparc64], libc0.1-i686 [kfreebsd-i386], libc0.3-i686 [hurd-i386], libc6-i686 [i386]
......@@ -176,7 +176,7 @@ Architecture: amd64 arm64 armel armhf hppa i386 m68k mips mipsel mipsn32 mipsn32
Section: libdevel
Priority: optional
Multi-Arch: same
Depends: libc6 (= ${binary:Version}) <!stage1>, libc-dev-bin (= ${binary:Version}), ${misc:Depends}, linux-libc-dev [linux-any], kfreebsd-kernel-headers (>= 0.11) [kfreebsd-any], gnumach-dev [hurd-i386], hurd-dev (>= 20080607-3) [hurd-i386] | hurd-headers-dev [hurd-i386]
Depends: libc6 (= ${binary:Version}) <!stage1>, libc-dev-bin (= ${binary:Version}), ${misc:Depends}, linux-libc-dev [linux-any], kfreebsd-kernel-headers (>= 0.11) [kfreebsd-any], gnumach-dev [hurd-i386], hurd-dev (>= 20080607-3) [hurd-i386] | hurd-headers-dev [hurd-i386], libcrypt1-dev
Replaces: hurd-dev (<< 20120408-3) [hurd-i386], kfreebsd-kernel-headers (<< 10.3~4) [kfreebsd-amd64 kfreebsd-i386]
Suggests: glibc-doc, manpages-dev
Provides: libc-dev, libc6-dev [alpha ia64 hurd-i386 kfreebsd-i386 kfreebsd-amd64]
......@@ -218,6 +218,7 @@ Package-Type: udeb
Architecture: amd64 arm64 armel armhf hppa i386 m68k mips mipsel mipsn32 mipsn32el mips64 mips64el mipsr6 mipsr6el mipsn32r6 mipsn32r6el mips64r6 mips64r6el nios2 powerpc ppc64 ppc64el riscv64 sparc sparc64 s390x sh3 sh4 x32
Section: debian-installer
Priority: optional
Depends: libcrypt1-udeb
Provides: libc6, libc-udeb, libnss-dns-udeb, libnss-files-udeb, ${locale-compat:Depends}
Build-Profiles: <!stage1>
Description: GNU C Library: Shared libraries - udeb
......@@ -233,7 +234,7 @@ Architecture: alpha ia64
Section: libs
Priority: optional
Multi-Arch: same
Depends: ${shlibs:Depends}, ${libgcc:Depends}
Depends: ${shlibs:Depends}, ${libgcc:Depends}, libcrypt1
Recommends: libidn2-0 (>= 2.0.5~)
Suggests: glibc-doc, debconf | debconf-2.0, libc-l10n, locales [!hurd-i386]
Provides: libc6-sparcv9b [sparc sparc64], libc0.1-i686 [kfreebsd-i386], libc0.3-i686 [hurd-i386], libc6-i686 [i386]
......@@ -265,7 +266,7 @@ Architecture: alpha ia64
Section: libdevel
Priority: optional
Multi-Arch: same
Depends: libc6.1 (= ${binary:Version}) <!stage1>, libc-dev-bin (= ${binary:Version}), ${misc:Depends}, linux-libc-dev [linux-any], kfreebsd-kernel-headers (>= 0.11) [kfreebsd-any], gnumach-dev [hurd-i386], hurd-dev (>= 20080607-3) [hurd-i386] | hurd-headers-dev [hurd-i386]
Depends: libc6.1 (= ${binary:Version}) <!stage1>, libc-dev-bin (= ${binary:Version}), ${misc:Depends}, linux-libc-dev [linux-any], kfreebsd-kernel-headers (>= 0.11) [kfreebsd-any], gnumach-dev [hurd-i386], hurd-dev (>= 20080607-3) [hurd-i386] | hurd-headers-dev [hurd-i386], libcrypt1-dev
Replaces: hurd-dev (<< 20120408-3) [hurd-i386], kfreebsd-kernel-headers (<< 10.3~4) [kfreebsd-amd64 kfreebsd-i386]
Suggests: glibc-doc, manpages-dev
Provides: libc-dev, libc6-dev [alpha ia64 hurd-i386 kfreebsd-i386 kfreebsd-amd64]
......@@ -307,6 +308,7 @@ Package-Type: udeb
Architecture: alpha ia64
Section: debian-installer
Priority: optional
Depends: libcrypt1-udeb
Provides: libc6.1, libc-udeb, libnss-dns-udeb, libnss-files-udeb, ${locale-compat:Depends}
Build-Profiles: <!stage1>
Description: GNU C Library: Shared libraries - udeb
......@@ -322,7 +324,7 @@ Architecture: hurd-i386
Section: libs
Priority: optional
Multi-Arch: same
Depends: ${shlibs:Depends}, ${libgcc:Depends}
Depends: ${shlibs:Depends}, ${libgcc:Depends}, libcrypt1
Recommends: libidn2-0 (>= 2.0.5~)
Suggests: glibc-doc, debconf | debconf-2.0, libc-l10n, locales [!hurd-i386]
Provides: libc6-sparcv9b [sparc sparc64], libc0.1-i686 [kfreebsd-i386], libc0.3-i686 [hurd-i386], libc6-i686 [i386]
......@@ -354,7 +356,7 @@ Architecture: hurd-i386
Section: libdevel
Priority: optional
Multi-Arch: same
Depends: libc0.3 (= ${binary:Version}) <!stage1>, libc-dev-bin (= ${binary:Version}), ${misc:Depends}, linux-libc-dev [linux-any], kfreebsd-kernel-headers (>= 0.11) [kfreebsd-any], gnumach-dev [hurd-i386], hurd-dev (>= 20080607-3) [hurd-i386] | hurd-headers-dev [hurd-i386]
Depends: libc0.3 (= ${binary:Version}) <!stage1>, libc-dev-bin (= ${binary:Version}), ${misc:Depends}, linux-libc-dev [linux-any], kfreebsd-kernel-headers (>= 0.11) [kfreebsd-any], gnumach-dev [hurd-i386], hurd-dev (>= 20080607-3) [hurd-i386] | hurd-headers-dev [hurd-i386], libcrypt1-dev
Replaces: hurd-dev (<< 20120408-3) [hurd-i386], kfreebsd-kernel-headers (<< 10.3~4) [kfreebsd-amd64 kfreebsd-i386]
Suggests: glibc-doc, manpages-dev
Provides: libc-dev, libc6-dev [alpha ia64 hurd-i386 kfreebsd-i386 kfreebsd-amd64]
......@@ -396,6 +398,7 @@ Package-Type: udeb
Architecture: hurd-i386
Section: debian-installer
Priority: optional
Depends: libcrypt1-udeb
Provides: libc0.3, libc-udeb, libnss-dns-udeb, libnss-files-udeb, ${locale-compat:Depends}
Build-Profiles: <!stage1>
Description: GNU C Library: Shared libraries - udeb
......@@ -411,7 +414,7 @@ Architecture: kfreebsd-amd64 kfreebsd-i386
Section: libs
Priority: optional
Multi-Arch: same
Depends: ${shlibs:Depends}, ${libgcc:Depends}
Depends: ${shlibs:Depends}, ${libgcc:Depends}, libcrypt1
Recommends: libidn2-0 (>= 2.0.5~)
Suggests: glibc-doc, debconf | debconf-2.0, libc-l10n, locales [!hurd-i386]
Provides: libc6-sparcv9b [sparc sparc64], libc0.1-i686 [kfreebsd-i386], libc0.3-i686 [hurd-i386], libc6-i686 [i386]
......@@ -443,7 +446,7 @@ Architecture: kfreebsd-amd64 kfreebsd-i386
Section: libdevel
Priority: optional
Multi-Arch: same
Depends: libc0.1 (= ${binary:Version}) <!stage1>, libc-dev-bin (= ${binary:Version}), ${misc:Depends}, linux-libc-dev [linux-any], kfreebsd-kernel-headers (>= 0.11) [kfreebsd-any], gnumach-dev [hurd-i386], hurd-dev (>= 20080607-3) [hurd-i386] | hurd-headers-dev [hurd-i386]
Depends: libc0.1 (= ${binary:Version}) <!stage1>, libc-dev-bin (= ${binary:Version}), ${misc:Depends}, linux-libc-dev [linux-any], kfreebsd-kernel-headers (>= 0.11) [kfreebsd-any], gnumach-dev [hurd-i386], hurd-dev (>= 20080607-3) [hurd-i386] | hurd-headers-dev [hurd-i386], libcrypt1-dev
Replaces: hurd-dev (<< 20120408-3) [hurd-i386], kfreebsd-kernel-headers (<< 10.3~4) [kfreebsd-amd64 kfreebsd-i386]
Suggests: glibc-doc, manpages-dev
Provides: libc-dev, libc6-dev [alpha ia64 hurd-i386 kfreebsd-i386 kfreebsd-amd64]
......@@ -485,6 +488,7 @@ Package-Type: udeb
Architecture: kfreebsd-amd64 kfreebsd-i386
Section: debian-installer
Priority: optional
Depends: libcrypt1-udeb
Provides: libc0.1, libc-udeb, libnss-dns-udeb, libnss-files-udeb, ${locale-compat:Depends}
Build-Profiles: <!stage1>
Description: GNU C Library: Shared libraries - udeb
......
......@@ -3,7 +3,7 @@ Architecture: @archs@
Section: libs
Priority: optional
Multi-Arch: same
Depends: ${shlibs:Depends}, ${libgcc:Depends}
Depends: ${shlibs:Depends}, ${libgcc:Depends}, libcrypt1
Recommends: libidn2-0 (>= 2.0.5~)
Suggests: glibc-doc, debconf | debconf-2.0, libc-l10n, locales [!hurd-i386]
Provides: libc6-sparcv9b [sparc sparc64], libc0.1-i686 [kfreebsd-i386], libc0.3-i686 [hurd-i386], libc6-i686 [i386]
......@@ -35,7 +35,7 @@ Architecture: @archs@
Section: libdevel
Priority: optional
Multi-Arch: same
Depends: @libc@ (= ${binary:Version}) <!stage1>, libc-dev-bin (= ${binary:Version}), ${misc:Depends}, linux-libc-dev [linux-any], kfreebsd-kernel-headers (>= 0.11) [kfreebsd-any], gnumach-dev [hurd-i386], hurd-dev (>= 20080607-3) [hurd-i386] | hurd-headers-dev [hurd-i386]
Depends: @libc@ (= ${binary:Version}) <!stage1>, libc-dev-bin (= ${binary:Version}), ${misc:Depends}, linux-libc-dev [linux-any], kfreebsd-kernel-headers (>= 0.11) [kfreebsd-any], gnumach-dev [hurd-i386], hurd-dev (>= 20080607-3) [hurd-i386] | hurd-headers-dev [hurd-i386], libcrypt1-dev
Replaces: hurd-dev (<< 20120408-3) [hurd-i386], kfreebsd-kernel-headers (<< 10.3~4) [kfreebsd-amd64 kfreebsd-i386]
Suggests: glibc-doc, manpages-dev
Provides: libc-dev, libc6-dev [alpha ia64 hurd-i386 kfreebsd-i386 kfreebsd-amd64]
......@@ -77,6 +77,7 @@ Package-Type: udeb
Architecture: @archs@
Section: debian-installer
Priority: optional
Depends: libcrypt1-udeb
Provides: @libc@, libc-udeb, libnss-dns-udeb, libnss-files-udeb, ${locale-compat:Depends}
Build-Profiles: <!stage1>
Description: GNU C Library: Shared libraries - udeb
......
......@@ -6,12 +6,12 @@ Build-Depends: gettext, dpkg (>= 1.18.7), dpkg-dev (>= 1.17.14), xz-utils, file,
linux-libc-dev (>= 3.9) [linux-any],
libaudit-dev [linux-any], libcap-dev [linux-any], libselinux-dev [linux-any],
mig (>= 1.5-3) [hurd-i386], gnumach-dev (>= 2:1.8+git20181103-1~) [hurd-i386],
hurd-dev (>= 1:0.9.git20181030-1) [hurd-i386] | hurd-headers-dev [hurd-i386],
hurd-dev (>= 1:0.9.git20181030-1) [hurd-i386] <!stage1> | libihash-dev [hurd-i386] <!stage1>,
hurd-dev (>= 1:0.9.git20191029-1) [hurd-i386] | hurd-headers-dev [hurd-i386],
hurd-dev (>= 1:0.9.git20191029-1) [hurd-i386] <!stage1> | libihash-dev [hurd-i386] <!stage1>,
kfreebsd-kernel-headers [kfreebsd-any],
binutils (>= 2.29),
g++-9, g++-9-multilib [amd64 i386 kfreebsd-amd64 mips mipsel mipsn32 mipsn32el mips64 mips64el mipsr6 mipsr6el mipsn32r6 mipsn32r6el mips64r6 mips64r6el powerpc ppc64 s390x sparc sparc64 x32] <!nobiarch>,
python3:native <!nocheck>,
python3:native,
libidn2-0 (>= 2.0.5~) <!nocheck>,
libc-bin (>= @GLIBC_VERSION@) <cross>
Build-Depends-Indep: perl, po-debconf (>= 1.0)
......
......@@ -102,6 +102,7 @@ libhurduser.so.0.3 #PACKAGE# #MINVER#
__file_lock@Base 2.11
__file_lock_stat@Base 2.11
__file_notice_changes@Base 2.11
__file_record_lock@Base 2.29-3~
__file_reparent@Base 2.11
__file_set_size@Base 2.11
__file_set_translator@Base 2.11
......@@ -479,6 +480,7 @@ libhurduser.so.0.3 #PACKAGE# #MINVER#
file_lock@Base 2.11
file_lock_stat@Base 2.11
file_notice_changes@Base 2.11
file_record_lock@Base 2.29-3~
file_reparent@Base 2.11
file_set_size@Base 2.11
file_set_translator@Base 2.11
......
---
elf/dl-load.c | 219 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 219 insertions(+)
--- a/elf/dl-load.c
+++ b/elf/dl-load.c
@@ -1438,6 +1438,209 @@
_dl_debug_printf_c ("\t\t(%s)\n", what);
}
+#ifdef __arm__
+/* Read an unsigned leb128 value from P, store the value in VAL, return
+ P incremented past the value. We assume that a word is large enough to
+ hold any value so encoded; if it is smaller than a pointer on some target,
+ pointers should not be leb128 encoded on that target. */
+static unsigned char *
+read_uleb128 (unsigned char *p, unsigned long *val)
+{
+ unsigned int shift = 0;
+ unsigned char byte;
+ unsigned long result;
+
+ result = 0;
+ do
+ {
+ byte = *p++;
+ result |= (byte & 0x7f) << shift;
+ shift += 7;
+ }
+ while (byte & 0x80);
+
+ *val = result;
+ return p;
+}
+
+
+#define ATTR_TAG_FILE 1
+#define ABI_VFP_args 28
+#define VFP_ARGS_IN_VFP_REGS 1
+
+/* Check consistency of ABI in the ARM attributes. Search through the
+ section headers looking for the ARM attributes section, then
+ check the VFP_ARGS attribute. */
+static int
+check_arm_attributes_hfabi(int fd, ElfW(Ehdr) *ehdr, bool *is_hf)
+{
+ unsigned int i;
+ ElfW(Shdr) *shdrs;
+ int sh_size = ehdr->e_shentsize * ehdr->e_shnum;
+
+ /* Load in the section headers so we can look for the attributes
+ * section */
+ shdrs = alloca(sh_size);
+ __lseek (fd, ehdr->e_shoff, SEEK_SET);
+ if ((size_t) __libc_read (fd, (void *) shdrs, sh_size) != sh_size)
+ return -1;
+
+ for (i = 0; i < ehdr->e_shnum; i++)
+ {
+ if (SHT_ARM_ATTRIBUTES == shdrs[i].sh_type)
+ {
+ /* We've found a likely section. Load the contents and
+ * check the tags */
+ unsigned char *contents = alloca(shdrs[i].sh_size);
+ unsigned char *p = contents;
+ unsigned char * end;
+
+ __lseek (fd, shdrs[i].sh_offset, SEEK_SET);
+ if ((size_t) __libc_read (fd, (void *) contents, shdrs[i].sh_size) != shdrs[i].sh_size)
+ return -1;
+
+ /* Sanity-check the attribute section details. Make sure
+ * that it's the "aeabi" section, that's all we care
+ * about. */
+ if (*p == 'A')
+ {
+ unsigned long len = shdrs[i].sh_size - 1;
+ unsigned long namelen;
+ p++;
+
+ while (len > 0)
+ {
+ unsigned long section_len = p[0] | p[1] << 8 | p[2] << 16 | p[3] << 24;
+ if (section_len > len)
+ {
+ _dl_debug_printf_c (" invalid section len %lu, max remaining %lu\n", section_len, len);
+ section_len = len;
+ }
+
+ p += 4;
+ len -= section_len;
+ section_len -= 4;
+
+ if (0 != strcmp((char *)p, "aeabi"))
+ {
+ _dl_debug_printf_c (" ignoring unknown attr section %s\n", p);
+ p += section_len;
+ continue;
+ }
+ namelen = strlen((char *)p) + 1;
+ p += namelen;
+ section_len -= namelen;
+
+ /* We're in a valid section. Walk through this
+ * section looking for the tag we care about
+ * (ABI_VFP_args) */
+ while (section_len > 0)
+ {
+ unsigned long val = 0;
+ unsigned long tag;
+ unsigned long size;
+
+ end = p;
+ tag = (*p++);
+
+ size = p[0] | p[1] << 8 | p[2] << 16 | p[3] << 24;
+ if (size > section_len)
+ {
+ _dl_debug_printf_c (" invalid subsection length %lu, max allowed %lu\n", size, section_len);
+ size = section_len;
+ }
+ p += 4;
+
+ section_len -= size;
+ end += size;
+ if (ATTR_TAG_FILE != tag)
+ {
+ /* ignore, we don't care */
+ _dl_debug_printf_c (" ignoring unknown subsection with type %lu length %lu\n", tag, size);
+ p = end;
+ continue;
+ }
+ while (p < end)
+ {
+ p = read_uleb128 (p, &tag);
+ /* Handle the different types of tag. */
+ if ( (tag == 4) || (tag == 5) || (tag == 67) )
+ {
+ /* Special cases for string values */
+ namelen = strlen((char *)p) + 1;
+ p += namelen;
+ }
+ else
+ {
+ p = read_uleb128 (p, &val);
+ }
+ if ( (tag == ABI_VFP_args) && (val == VFP_ARGS_IN_VFP_REGS) )
+ {
+ *is_hf = 1;
+ return 0;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return 0;
+}
+
+
+/* ARM-specific checks. If we're built using the HF ABI, then fail any
+ attempts to use the SF ABI (and vice versa). Then, check for
+ consistency of ABI in terms of passing VFP args. */
+static int
+arm_specific_checks(int fd, const char *name, ElfW(Ehdr) *ehdr)
+{
+ static int all_hf = -1; /* unset */
+ bool is_hf = false;
+ int ret;
+
+ ret = check_arm_attributes_hfabi(fd, ehdr, &is_hf);
+ if (ret != 0)
+ return ret;
+
+#ifdef __ARM_PCS_VFP
+ if (!is_hf)
+ return EINVAL;
+#else
+ if (is_hf)
+ return EINVAL;
+#endif
+
+ if (all_hf == -1)
+ {
+ if (is_hf)
+ all_hf = 1;
+ else
+ all_hf = 0;
+ }
+ else if (all_hf == 1 && !is_hf)
+ return EINVAL;
+ else if (all_hf == 0 && is_hf)
+ return EINVAL;
+ return 0;
+}
+#endif
+
+
+/* Run any architecture-specific checks that might be needed for the
+ current architecture. */
+static int
+arch_specific_checks(int fd, const char *name, ElfW(Ehdr) *ehdr)
+{
+#ifdef __arm__
+ return arm_specific_checks(fd, name, ehdr);
+#endif
+
+ return 0;
+}
+
+
/* Open a file and verify it is an ELF file for this architecture. We
ignore only ELF files for other architectures. Non-ELF files and
ELF files with different header information cause fatal errors since
@@ -1676,6 +1879,7 @@
/* Check .note.ABI-tag if present. */
for (ph = phdr; ph < &phdr[ehdr->e_phnum]; ++ph)
+ {
if (ph->p_type == PT_NOTE && ph->p_filesz >= 32 && ph->p_align >= 4)
{
ElfW(Addr) size = ph->p_filesz;
@@ -1751,6 +1955,20 @@
break;
}
+ if (-1 != fd)
+ {
+ int error = arch_specific_checks(fd, name, ehdr);
+ if (EINVAL == error)
+ {
+ goto close_and_out;
+ }
+ if (0 != error)
+ {
+ errstring = N_("Unable to run arch-specific checks\n");
+ goto call_lose;
+ }
+ }
+ }
free (abi_note_malloced);
}
This diff is collapsed.
commit 0b262ca4c64cd9042576ddb9969607c0ea1187d7
Author: Svante Signell <svante.signell@gmail.com>
Date: Wed Oct 30 01:23:41 2019 +0100
hurd: Support for file record locking
* sysdeps/mach/hurd/fcntl.c: Add support for file-record-lock RPC
fixing posix file locking using the flock64 version of struct
flock.
diff --git a/sysdeps/mach/hurd/fcntl.c b/sysdeps/mach/hurd/fcntl.c
index 26243682ca..0e3f0adbd9 100644
--- a/sysdeps/mach/hurd/fcntl.c
+++ b/sysdeps/mach/hurd/fcntl.c
@@ -130,23 +130,75 @@ __libc_fcntl (int fd, int cmd, ...)
case F_SETLKW:
{
struct flock *fl = va_arg (ap, struct flock *);
- int wait = 0;
- va_end (ap);
+
switch (cmd)
{
case F_GETLK:
- errno = ENOSYS;
- return -1;
- case F_SETLKW:
- wait = 1;
- /* FALLTHROUGH */
+ cmd = F_GETLK64;
+ break;
case F_SETLK:
- return __f_setlk (fd, fl->l_type, fl->l_whence,
- fl->l_start, fl->l_len, wait);
+ cmd = F_SETLK64;
+ break;
+ case F_SETLKW:
+ cmd = F_SETLKW64;
+ break;
default:
errno = EINVAL;
return -1;
}
+
+ struct flock64 fl64 = {
+ .l_type = fl->l_type,
+ .l_whence = fl->l_whence,
+ .l_start = fl->l_start,
+ .l_len = fl->l_len,
+ .l_pid = fl->l_pid
+ };
+
+ err = HURD_FD_PORT_USE (d, __file_record_lock (port, cmd, &fl64,
+ MACH_PORT_NULL, MACH_MSG_TYPE_MAKE_SEND));
+
+ /* XXX: To remove once file_record_lock RPC is settled. */
+ if (err == EMIG_BAD_ID || err == EOPNOTSUPP)
+ {
+ int wait = 0;
+ va_end (ap);
+ switch (cmd)
+ {
+ case F_GETLK64:
+ errno = ENOSYS;
+ return -1;
+ case F_SETLKW64:
+ wait = 1;
+ /* FALLTHROUGH */
+ case F_SETLK64:
+ return __f_setlk (fd, fl->l_type, fl->l_whence,
+ fl->l_start, fl->l_len, wait);
+ default:
+ errno = EINVAL;
+ return -1;
+ }
+ }
+ else if (cmd == F_GETLK64)
+ {
+ fl->l_type = fl64.l_type;
+ fl->l_whence = fl64.l_whence;
+ fl->l_start = fl64.l_start;
+ fl->l_len = fl64.l_len;
+ fl->l_pid = fl64.l_pid;
+
+ if ((sizeof fl->l_start != sizeof fl64.l_start
+ && fl->l_start != fl64.l_start)
+ || (sizeof fl->l_len != sizeof fl64.l_len
+ && fl->l_len != fl64.l_len))
+ {
+ errno = EOVERFLOW;
+ return -1;
+ }
+ }
+
+ result = err ? __hurd_dfail (fd, err) : 0;
+ break;
}
case F_GETLK64:
@@ -154,23 +206,34 @@ __libc_fcntl (int fd, int cmd, ...)
case F_SETLKW64:
{
struct flock64 *fl = va_arg (ap, struct flock64 *);
- int wait = 0;
- va_end (ap);
- switch (cmd)
+
+ err = HURD_FD_PORT_USE (d, __file_record_lock (port, cmd, fl,
+ MACH_PORT_NULL, MACH_MSG_TYPE_MAKE_SEND));
+
+ /* XXX: To remove once file_record_lock RPC is settled. */
+ if (err == EMIG_BAD_ID || err == EOPNOTSUPP)
{
- case F_GETLK64:
- errno = ENOSYS;
- return -1;
- case F_SETLKW64:
- wait = 1;
- /* FALLTHROUGH */
- case F_SETLK64:
- return __f_setlk (fd, fl->l_type, fl->l_whence,
- fl->l_start, fl->l_len, wait);
- default:
- errno = EINVAL;
- return -1;
+ int wait = 0;
+ va_end (ap);
+ switch (cmd)
+ {
+ case F_GETLK64:
+ errno = ENOSYS;
+ return -1;
+ case F_SETLKW64:
+ wait = 1;
+ /* FALLTHROUGH */
+ case F_SETLK64:
+ return __f_setlk (fd, fl->l_type, fl->l_whence,
+ fl->l_start, fl->l_len, wait);
+ default:
+ errno = EINVAL;
+ return -1;
+ }
}
+
+ result = err ? __hurd_dfail (fd, err) : 0;
+ break;
}
case F_GETFL: /* Get per-open flags. */
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
Subject: [PATCH] Make F_RDLCK/F_WRLCK atomic
lockf(LOCK_EX) would for instance drop any existing shared lock before taking
the exclusive lock. F_RDLCK/F_WRLCK need atomic changes, so introduce and use
__LOCK_ATOM
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
* misc/sys/file.h (__LOCK_ATOMIC): New macro.
* sysdeps/mach/hurd/fcntl.c (__libc_fcntl): Use __LOCK_ATOMIC along LOCK_SH and
LOCK_EX.
XXX: Adding to misc/sys/file.h is questionable
---
misc/sys/file.h | 1 +
sysdeps/mach/hurd/fcntl.c | 4 ++--
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/misc/sys/file.h b/misc/sys/file.h
index 64e8764..a5892db 100644
--- a/misc/sys/file.h
+++ b/misc/sys/file.h
@@ -40,6 +40,7 @@ __BEGIN_DECLS
#define LOCK_SH 1 /* Shared lock. */
#define LOCK_EX 2 /* Exclusive lock. */
#define LOCK_UN 8 /* Unlock. */
+#define __LOCK_ATOMIC 16 /* Atomic update. */
/* Can be OR'd in to one of the above. */
#define LOCK_NB 4 /* Don't block when locking. */
diff --git a/sysdeps/mach/hurd/fcntl.c b/sysdeps/mach/hurd/fcntl.c
index 70180fa..8a8308f 100644
--- a/sysdeps/mach/hurd/f_setlk.c
+++ b/sysdeps/mach/hurd/f_setlk.c
@@ -150,8 +150,8 @@ __libc_fcntl (int fd, int cmd, ...)
switch (type)
{
- case F_RDLCK: cmd = LOCK_SH; break;
- case F_WRLCK: cmd = LOCK_EX; break;
+ case F_RDLCK: cmd = LOCK_SH | __LOCK_ATOMIC; break;
+ case F_WRLCK: cmd = LOCK_EX | __LOCK_ATOMIC; break;
case F_UNLCK: cmd = LOCK_UN; break;
default:
errno = EINVAL;
--
tg: (9a079e2..) t/WRLCK-upgrade (depends on: baseline)
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
Subject: [PATCH] Fix installation of locales-all
Dirty hack to fix installation of locales-all: instead of just locking the
archive extension (which is not supported on hurd-i386), lock it all.
---
locale/programs/locarchive.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
--- a/locale/programs/locarchive.c
+++ b/locale/programs/locarchive.c
@@ -453,7 +453,16 @@ enlarge_archive (struct locarhandle *ah,
}
/* Lock the new file. */
+#ifdef __GNU__
+ struct flock fl;
+ fl.l_whence = SEEK_SET;
+ fl.l_start = 0;
+ fl.l_len = 0;
+ fl.l_type = F_WRLCK;
+ if (fcntl(fd, F_SETLKW, &fl) != 0)
+#else
if (lockf64 (fd, F_LOCK, total) != 0)
+#endif
{
int errval = errno;
unlink (fname);
@@ -613,7 +622,16 @@ open_archive (struct locarhandle *ah, bo
error (EXIT_FAILURE, errno, _("cannot stat locale archive \"%s\""),
archivefname);
+#ifdef __GNU__
+ struct flock fl;
+ fl.l_whence = SEEK_SET;
+ fl.l_start = 0;
+ fl.l_len = 0;
+ fl.l_type = F_WRLCK;
+ if (!readonly && fcntl(fd, F_SETLKW, &fl) == -1)
+#else
if (!readonly && lockf64 (fd, F_LOCK, sizeof (struct locarhead)) == -1)
+#endif
{
close (fd);
......@@ -25,7 +25,6 @@ alpha/submitted-makecontext.diff
arm/local-sigaction.diff
arm/unsubmitted-ldconfig-cache-abi.diff
arm/unsubmitted-ldso-abi-check.diff
arm/local-soname-hack.diff
arm/local-vfp-sysdeps.diff
arm/unsubmitted-ldso-multilib.diff
......@@ -40,7 +39,6 @@ hurd-i386/tg-sysvshm.diff
hurd-i386/tg-thread-cancel.diff
hurd-i386/tg-bigmem.diff
hurd-i386/local-disable-ioctls.diff
hurd-i386/tg-locarchive.diff
hurd-i386/tg-sendmsg-SCM_RIGHTS.diff
hurd-i386/tg-sendmsg-SCM_CREDS.diff
hurd-i386/tg-mach-hurd-link.diff
......@@ -69,14 +67,14 @@ hurd-i386/tg-sigstate_thread_reference.diff
hurd-i386/submitted-bind_umask2.diff
hurd-i386/tg-bootstrap.diff
hurd-i386/local-mach_print.diff
hurd-i386/git-anon-mmap-shared.diff
#hurd-i386/git-anon-mmap-shared.diff
hurd-i386/tg-eintr.diff
hurd-i386/tg-libc_rwlock_recursive.diff
hurd-i386/local-no_unsupported_ioctls.diff
hurd-i386/local-exec_filename.diff
hurd-i386/libpthread_sigs.diff
hurd-i386/local-hurd_sigstate-PLT.diff
hurd-i386/tg-WRLCK-upgrade.diff
hurd-i386/git-rlock.diff
i386/local-biarch.diff
i386/unsubmitted-quiet-ldconfig.diff
......
......@@ -89,6 +89,7 @@ rtlddir=/lib
slibdir=/lib/$(DEB_HOST_MULTIARCH)
libdir=/usr/lib/$(DEB_HOST_MULTIARCH)
mvec = no
crypt = no
BASE_CC = gcc
......
......@@ -94,6 +94,7 @@ $(stamp)configure_%: $(stamp)config_sub_guess $(stamp)patch $(KERNEL_HEADER_DIR)
$(if $(filter $(pt_chown),yes),--enable-pt_chown) \
$(if $(filter $(threads),no),--disable-nscd) \
$(if $(filter $(call xx,mvec),no),--disable-mathvec) \
$(if $(filter $(call xx,crypt),no),--disable-crypt) \
$(call xx,with_headers) $(call xx,extra_config_options)
touch $@
......
......@@ -242,6 +242,7 @@ $(stamp)debhelper_%: $(stamp)debhelper-common $(stamp)install_%
sed -e "s#RTLD_SO#$$rtld_so#g" -i $$t ; \
sed -e "s#MULTIARCHDIR#$$DEB_HOST_MULTIARCH#g" -i $$t ; \
$(if $(filter $(call xx,mvec),no),sed -e "/libmvec/d" -e "/libm-\*\.a/d" -i $$t ;) \
$(if $(filter $(call xx,crypt),no),sed -e "/libcrypt/d" -i $$t ;) \
$(if $(filter-out $(DEB_HOST_ARCH_OS),linux),sed -e "/gdb/d" -i $$t ;) \
done ; \
done
......
echo -n "Checking for services that may need to be restarted..."
# Only get the ones that are installed, and configured
check=$(dpkg -s $check 2> /dev/null | egrep '^Package:|^Status:' | awk '{if ($1 ~ /^Package:/) { package=$2 } else if ($0 ~ /^Status: .* installed$/) { print package }}')
# Only get the ones that are installed, of the same architecture
# as libc (or arch all) and configured
check=$(dpkg-query -W -f='${binary:Package} ${Status} ${Architecture}\n' $check 2> /dev/null | \
grep -E "installed (all|${DPKG_MAINTSCRIPT_ARCH})$" | sed 's/[: ].*//')
# some init scripts don't match the package names
check=$(echo $check | \
sed -e's/\bapache2.2-common\b/apache2/g' \
......
......@@ -15,6 +15,7 @@ libc6-i386_shlib_dep = libc6-i386 (>= $(shlib_dep_ver))
i386_configure_target = i686-linux-gnu
i386_CC = $(CC) -m32 -march=pentium4 -mtune=generic
i386_CXX = $(CXX) -m32 -march=pentium4 -mtune=generic
i386_crypt = yes
i386_slibdir = /lib32
i386_libdir = /usr/lib32
......@@ -50,6 +51,7 @@ x32_configure_target = x86_64-linux-gnux32
x32_CC = $(CC) -mx32
x32_CXX = $(CXX) -mx32
x32_mvec = yes
x32_crypt = yes
x32_rtlddir = /libx32
x32_slibdir = /libx32
x32_libdir = /usr/libx32
......
......@@ -10,6 +10,7 @@ ifeq (,$(filter nobiarch, $(DEB_BUILD_PROFILES)))
#armhf_configure_target = arm-linux-gnueabihf
#armhf_CC = $(CC) -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard
#armhf_CXX = $(CXX) -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard
#armhf_crypt = yes
#armhf_slibdir = /lib/arm-linux-gnueabihf
#armhf_libdir = /usr/lib/arm-linux-gnueabihf
#
......
......@@ -21,6 +21,7 @@ ifeq (,$(filter nobiarch, $(DEB_BUILD_PROFILES)))
#armel_configure_target = arm-linux-gnueabi
#armel_CC = $(CC) -mfloat-abi=soft
#armel_CXX = $(CXX) -mfloat-abi=soft
#armel_crypt = yes
#armel_slibdir = /lib/arm-linux-gnueabi
#armel_libdir = /usr/lib/arm-linux-gnueabi
#
......
......@@ -38,6 +38,7 @@ amd64_configure_target = x86_64-linux-gnu
# /usr/include/asm wrappers need that symbol.
amd64_CC = $(CC) -m64 -D__x86_64__
amd64_CXX = $(CXX) -m64 -D__x86_64__
amd64_crypt = yes
amd64_mvec = yes
amd64_rtlddir = /lib64
amd64_slibdir = /lib64
......@@ -74,6 +75,7 @@ libc6-x32_shlib_dep = libc6-x32 (>= $(shlib_dep_ver))
x32_configure_target = x86_64-linux-gnux32
x32_CC = $(CC) -mx32
x32_CXX = $(CXX) -mx32
x32_crypt = yes
x32_mvec = yes
x32_rtlddir = /libx32
x32_slibdir = /libx32
......
......@@ -11,6 +11,7 @@ i386_add-ons = $(libc_add-ons)
i386_configure_target = i686-kfreebsd-gnu
i386_CC = $(CC) -m32 -march=pentium4 -mtune=generic
i386_CXX = $(CXX) -m32 -march=pentium4 -mtune=generic
i386_crypt = yes
i386_slibdir = /lib32
i386_libdir = /usr/lib32
......