Your message dated Sun, 15 Jul 2018 21:37:06 +0000
with message-id <[email protected]>
and subject line Bug#891924: fixed in klibc 2.0.4-12
has caused the Debian Bug report #891924,
regarding klibc: crashes on mips64el if any syscall fails
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
891924: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=891924
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: libklibc
Version: 2.0.4-11
Severity: important
Tags: patch upstream
[Possibly this should be RC, but most things do indeed work - I'll leave
that up to you]
Hi,
I recently noticed that a mips64el initramfs built in unstable was
giving an unusual error (the boot continues as if no error had happened):
> Begin: Running /scripts/init-bottom ... Bus error
> done.
I traced this bug to the "nuke" command which ends up (intentionally)
calling unlink on a directory. A Bus Error then happened in the klibc
syscall handler when writing the new errno.
This happens because klibc is compiled with PIC enabled on mips64el and
the assembler expects the PIC $gp register to be set up correctly for
the store to work. Since it contained a bogus value, the program failed.
I think that when PIE was not enabled in 2.0.4-9, applications wouldn't
mess with the $gp register and by chance it happened to be the correct
value when entering the syscall handler.
I have fixed the bug in the attached patch which disables PIC code
(using the -mno-abicalls option) and adjusted the link flags so the
build still works.
I also submitted this patch and a few others upstream. The other patches
are mostly cleanups and are not that important. They will probably
appear here when the archives refresh themselves:
http://www.zytor.com/pipermail/klibc/2018-March/thread.html
Thanks,
James
From 65bf5068d8f65cb26b1550b1c0f3c4f7db5d6e12 Mon Sep 17 00:00:00 2001
From: James Cowgill <[email protected]>
Date: Fri, 2 Mar 2018 14:48:21 +0000
Subject: [PATCH 1/5] mips64: compile with -mno-abicalls
By default, the MIPS toolchain compiles all code as PIC. Since klibc
links everything at static addresses, we don't need PIC code so use
-mno-abicalls to disable it. To fix subsequent link errors, use
-Ttext-segment to adjust the base address of klibc to a more sensible
location.
This fixes a bug in the shared library form of klibc where programs
would segfault in the syscall handler because we tried to store into the
"errno" variable without setting up the gp register. This is only required
under the PIC ABI.
Signed-off-by: James Cowgill <[email protected]>
---
usr/klibc/arch/mips64/MCONFIG | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/usr/klibc/arch/mips64/MCONFIG b/usr/klibc/arch/mips64/MCONFIG
index b37cc6a7..6a4b41b2 100644
--- a/usr/klibc/arch/mips64/MCONFIG
+++ b/usr/klibc/arch/mips64/MCONFIG
@@ -7,7 +7,17 @@
# accordingly.
#
+KLIBCARCHREQFLAGS = -fno-pic -mno-abicalls -G 0
KLIBCOPTFLAGS += -Os
KLIBCBITSIZE = 64
-KLIBCSHAREDFLAGS = -T $(src)/arch/mips/klibc.ld
+# Extra linkflags when building the shared version of the library
+# This address needs to be reachable using normal inter-module
+# calls, and work on the memory models for this architecture
+# 4862 MB - normal binaries start at 4608 MB. Non-PIC jumps usually
+# use the JAL instruction which requires a destination within the same
+# 256M aligned region. Since we can't put ourselves below the normal
+# load address, use the very top of the 256M region (minus 2MB)
+#
+# Use -Ttext-segment so that the special .MIPS* sections are moved as well.
+KLIBCSHAREDFLAGS = -Ttext-segment 0x12FE00000
--
2.16.2
signature.asc
Description: OpenPGP digital signature
--- End Message ---
--- Begin Message ---
Source: klibc
Source-Version: 2.0.4-12
We believe that the bug you reported is fixed in the latest version of
klibc, which is due to be installed in the Debian FTP archive.
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Ben Hutchings <[email protected]> (supplier of updated klibc package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Format: 1.8
Date: Sun, 15 Jul 2018 22:22:07 +0100
Source: klibc
Binary: libklibc-dev libklibc klibc-utils
Architecture: source
Version: 2.0.4-12
Distribution: unstable
Urgency: medium
Maintainer: maximilian attems <[email protected]>
Changed-By: Ben Hutchings <[email protected]>
Description:
klibc-utils - small utilities built with klibc for early boot
libklibc - minimal libc subset for use with initramfs
libklibc-dev - kernel headers used during the build of klibc
Closes: 863761 884716 886939 891924 903849
Changes:
klibc (2.0.4-12) unstable; urgency=medium
.
[ Ben Hutchings ]
* debian/control: Point Vcs URLs to Salsa
* debian/klibc-utils.postinst: Remove diversion of initramfs-tools hook
script (Closes: #886939)
* [klibc] mips64: compile with -mno-abicalls, thanks to James Cowgill
(Closes: #891924)
* reboot: Add support for reboot syscall argument, thanks to Alfonso
Sanchez-Beato (Closes: #863761, LP: #1692494)
* [klibc] x86_64: Reduce ld max-page-size option again (Closes: #903849)
* Never clean files in quilt status directory
.
[ Frank Scheiner ]
* [klibc] ia64: Build static tools (again)
.
[ Benjamin Drung ]
* ipconfig: Implement classless static routes (Closes: #884716, LP: #1526956)
* mount_main: Fix empty string check
Checksums-Sha1:
fa6f64a531a165ff4bdb91ca1837937665ff5481 2031 klibc_2.0.4-12.dsc
fb18065967c348abf6d7f244cca72d5fa3ebe167 37588 klibc_2.0.4-12.debian.tar.xz
66dda1bc3a2c3ca5182ab589c7ff47c8b00fba8e 5944 klibc_2.0.4-12_source.buildinfo
Checksums-Sha256:
de8078b3b7e13a2242b470cf54ffed8b94ea8251ee9754125e46cbd1c49c01eb 2031
klibc_2.0.4-12.dsc
626471808ca50fc7812c05b91dc21c9ee170dd0908052707c6dedd3f0a0dd77f 37588
klibc_2.0.4-12.debian.tar.xz
8cb10acbaa2dab9f60ca5fa35902d01e0921ce86677a68b8ccdfc436f6ee907a 5944
klibc_2.0.4-12_source.buildinfo
Files:
ff65d734e012b8015ed2453ff772b1d2 2031 libs optional klibc_2.0.4-12.dsc
fb8b4a2c57822aadd1992723d9f01df6 37588 libs optional
klibc_2.0.4-12.debian.tar.xz
ca06e9bc2786acf8ee7e7e895579d999 5944 libs optional
klibc_2.0.4-12_source.buildinfo
-----BEGIN PGP SIGNATURE-----
iQIzBAEBCgAdFiEErCspvTSmr92z9o8157/I7JWGEQkFAltLuyQACgkQ57/I7JWG
EQlfpw//dX5zfuZPaKnVDfyCXM9Usx6mhLCeI6DI/b85IlPGcMQGfftRfIMXSfsW
mp1SEHaNuforocIleoTAOWiDIITaFhbX8BxnZF20VesEYjzjxbZBS1tF8wOm/mbO
giFkjIzko2RCqlso0/RL0RZj+n4ISHZlo/IsFUNngR5520DnC3S7ARQockGRxyus
3GUzfv7CxXgQPOjChTE9NskK10vC749vOwlsmfkW4adSOVn6Ney0bBhvNViurRmj
Yc1EVWSSolmVcivLIKFosRhcvO3Sv7XbvZ8yZ1k/QCAOlEpfHF929ztfSwnkQqaZ
+kCWnNEgqD+22jvM+JPrsWr9RBc0daPepCUaXxkZsu6NS3K/bInhiUt2z70vnw4d
O7CqBbb2BYl4irwAMaVYftZ/cb6yBfgk22EvhGHBenAxg0V7m8CBBBlhIJYM/YNF
GKoiyCZQPhw7l1c/kPiJJf/b3feIu259vhAvBcylrZUOPxMefq0z39TRY0p/1Ab6
mqGy198uq5FPhLT9KkwFf5znYWWeFnTP0UtW/Lbbc+0JMM+dUUyfN1B9tU6cWHX4
jr5XsY7f6d07fXxWokj8hKyFhF+kUDil+myhjtnLgejAzB5CK3aFt9RZjzpVf0wY
XIX5whitfo1jtESwYUwQ1OS3IGJqbo570E8dpD8XfbYvTru9o5Y=
=ubk2
-----END PGP SIGNATURE-----
--- End Message ---