Your message dated Tue, 16 Feb 2021 09:36:54 +0000
with message-id <[email protected]>
and subject line Bug#970460: fixed in qemu 1:5.2+dfsg-6
has caused the Debian Bug report #970460,
regarding qemu-user: trashes argv[0] breaking multi-call binaries
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.)
--
970460: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=970460
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: qemu-user
Version: 1:5.1+dfsg-4
Severity: important
X-Debbugs-Cc: [email protected], [email protected]
I’m attaching a test program that does the following:
• if argv[1] is "-" it just outputs argv[0] and argv[1]
• otherwise it also execve(2)s argv[1] with its argv[0] set to "meow"
I’ve installed the extra packages:
• gcc-arm-linux-gnueabi
• libc6-dev-armel-cross
tglase@tglase-nb:~ $ gcc -Wall -Wextra -o native tst.c
1|tglase@tglase-nb:~ $ ./native ./native
argv[0]: ./native
argv[1]: ./native
calling...
argv[0]: meow
argv[1]: -
not calling
tglase@tglase-nb:~ $ arm-linux-gnueabi-gcc -o cross tst.c -static
tglase@tglase-nb:~ $ ./cross ./cross
argv[0]: ./cross
argv[1]: ./cross
calling...
argv[0]: ./cross
argv[1]: -
not calling
tglase@tglase-nb:~ $ ./cross ./native
argv[0]: ./cross
argv[1]: ./native
calling...
argv[0]: meow
argv[1]: -
not calling
tglase@tglase-nb:~ $ ./native ./cross
argv[0]: ./native
argv[1]: ./cross
calling...
argv[0]: ./cross
argv[1]: -
not calling
As you can see, if the callee of an exec is a qemu-user target,
argv[0] is trashed.
This, among other things, makes qemu-user-static-based buildds unworkable.
-- System Information:
Debian Release: bullseye/sid
APT prefers unstable-debug
APT policy: (500, 'unstable-debug'), (500, 'oldstable-updates'), (500,
'buildd-unstable'), (500, 'unstable'), (500, 'oldstable'), (1,
'experimental-debug'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 5.7.0-2-amd64 (SMP w/2 CPU threads)
Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /bin/lksh
Init: sysvinit (via /sbin/init)
Versions of packages qemu-user depends on:
ii libc6 2.31-3
ii libcapstone3 4.0.1+really+3.0.5-2
ii libgcc-s1 10.2.0-7
ii libglib2.0-0 2.66.0-1
ii libgnutls30 3.6.15-2
ii libstdc++6 10.2.0-7
ii zlib1g 1:1.2.11.dfsg-2
Versions of packages qemu-user recommends:
ii qemu-user-static [qemu-user-binfmt] 1:5.1+dfsg-4
Versions of packages qemu-user suggests:
ii sudo 1.9.1-2
-- no debconf information
#include <err.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
int
main(int argc, char *argv[], char *envp[])
{
char *newargv[3];
if (argc != 2) {
fprintf(stderr, "usage: %s <program-to-call>\n", argv[0]);
return (1);
}
printf("argv[%d]: %s\n", 0, argv[0]);
printf("argv[%d]: %s\n", 1, argv[1]);
if (strcmp(argv[1], "-") != 0) {
printf("calling...\n");
newargv[0] = "meow";
newargv[1] = "-";
newargv[2] = NULL;
execve(argv[1], newargv, envp);
err(1, "exec");
}
printf("not calling\n");
return (0);
}
--- End Message ---
--- Begin Message ---
Source: qemu
Source-Version: 1:5.2+dfsg-6
Done: Michael Tokarev <[email protected]>
We believe that the bug you reported is fixed in the latest version of
qemu, 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.
Michael Tokarev <[email protected]> (supplier of updated qemu 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: SHA256
Format: 1.8
Date: Tue, 16 Feb 2021 12:11:20 +0300
Source: qemu
Architecture: source
Version: 1:5.2+dfsg-6
Distribution: unstable
Urgency: medium
Maintainer: Debian QEMU Team <[email protected]>
Changed-By: Michael Tokarev <[email protected]>
Closes: 901197 970460
Changes:
qemu (1:5.2+dfsg-6) unstable; urgency=medium
.
* deprecate qemu-debootstrap. It is not needed anymore with
binfmt F flag, since everything now works without --foreign
debootstrap argument and copying the right qemu binary into
the chroot. Closes: #901197
* fix the brown-paper bag bug: wrong argument order
in the linux-user-binfmt patch (really closes: #970460)
Checksums-Sha1:
eb88b20f00f18f57b6516e97b0a92d55bb7aa3a8 6600 qemu_5.2+dfsg-6.dsc
4e8fc7213fd88329f3474b6e18e3b1806914eb8a 102644 qemu_5.2+dfsg-6.debian.tar.xz
125ed6761fc8871943f27bade6aa0dce80ebc4e7 9102 qemu_5.2+dfsg-6_source.buildinfo
Checksums-Sha256:
5a3a66019f141975ac79546b24c912ef1c26f5f836e6b4227bd29a01d58d1f7d 6600
qemu_5.2+dfsg-6.dsc
f6ed649b8591a351a3c270461716dabbdf2252086e196cb97579fa7d5e30d36d 102644
qemu_5.2+dfsg-6.debian.tar.xz
8d0ba20918a2bd6702a15f4d47625726908b6dc52b72bf31c83c6639451cac70 9102
qemu_5.2+dfsg-6_source.buildinfo
Files:
399d7eb4d4e205f5503f99c3666228bc 6600 otherosfs optional qemu_5.2+dfsg-6.dsc
805b6194ae44a5a7fce31d90bcfa8b40 102644 otherosfs optional
qemu_5.2+dfsg-6.debian.tar.xz
e874ac04eba95889660748cbb39c89a2 9102 otherosfs optional
qemu_5.2+dfsg-6_source.buildinfo
-----BEGIN PGP SIGNATURE-----
iQFDBAEBCAAtFiEEe3O61ovnosKJMUsicBtPaxppPlkFAmArjQAPHG1qdEB0bHMu
bXNrLnJ1AAoJEHAbT2saaT5Zw/wH/0e2DukpWC0fsDeM0nuPDiT2YdnHTgPgnvIX
7R8/zMu20Lqc4qo50xsnf6PpptYSjBgVXGQFxrzdoANjzhnuL9IBPF77i3EjrKd3
V6fVT0Y0AdtI2SjmdHt73laURzAJ/qA43fwsDui+pwUBMiGiMnInkw5Q0fmIaKNs
OlM+LM2Q0svJXfNVNIYlDLNgsucHxTQJDXf0rFEP7RT56+adOMqzR2dgtACLw6Z4
2EDfGEITDP3W6z6vZTJjf+dtnTYsSt5V84FrHnm6M387ZYJEie67AXspmwJAztn8
+/p4iiUlOo2Co+MNsjdiOB5sXl0jAR7i80mKEyMDdeeEjtT2+MM=
=m9CA
-----END PGP SIGNATURE-----
--- End Message ---