Debian Bug report logs - #868030
qemu-user-static: Please enable "F - fix binary" flag for binfmt entries

version graph

Package: qemu-user-static; Maintainer for qemu-user-static is Debian QEMU Team <pkg-qemu-devel@lists.alioth.debian.org>; Source for qemu-user-static is src:qemu (PTS, buildd, popcon).

Reported by: Ian Campbell <ijc@debian.org>

Date: Tue, 11 Jul 2017 10:51:02 UTC

Severity: wishlist

Tags: patch

Found in version qemu/1:2.8+dfsg-6

Fixed in version qemu/1:2.12~rc3+dfsg-1

Done: Michael Tokarev <mjt@tls.msk.ru>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Debian QEMU Team <pkg-qemu-devel@lists.alioth.debian.org>:
Bug#868030; Package qemu-user-static. (Tue, 11 Jul 2017 10:51:04 GMT) (full text, mbox, link).


Acknowledgement sent to Ian Campbell <ijc@debian.org>:
New Bug report received and forwarded. Copy sent to Debian QEMU Team <pkg-qemu-devel@lists.alioth.debian.org>. (Tue, 11 Jul 2017 10:51:04 GMT) (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Ian Campbell <ijc@debian.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: qemu-user-static: Please enable "F - fix binary" flag for binfmt entries
Date: Tue, 11 Jul 2017 11:46:25 +0100
Package: qemu-user-static
Version: 1:2.8+dfsg-6
Severity: wishlist

Dear Maintainer,

Please consider enabling the "F" flag in the binfmt entries which this package
adds. From https://www.kernel.org/doc/html/v4.12/admin-guide/binfmt-misc.html:

F - fix binary

    The usual behaviour of binfmt_misc is to spawn the binary lazily when the
    misc format file is invoked. However, this doesn``t work very well in the face
    of mount namespaces and changeroots, so the F mode opens the binary as soon as
    the emulation is installed and uses the opened image to spawn the emulator,
    meaning it is always available once installed, regardless of how the
    environment changes.

This is useful because it avoids the need to bind mount the qemu-user-static
binaries into the container/chroot/whatever.

The documentation entry appears to have been added in Linux v4.8-rc1 so I
pressume the feature was present at some point before then and is in any case
available in the 4.9 kernel used by Stretch, so enabling this in the Buster
onwards versions of this package ought to be reasonable I think.

I'm not sure if this also applies to the qemu-user-binfmt package, that's
dynamically linked and I confess I'm not sure how that works WRT chroots and
such.

Thanks,
Ian.

-- System Information:
Debian Release: 9.0
  APT prefers stable
  APT policy: (990, 'stable'), (500, 'oldstable-updates'), (500, 'unstable'), (500, 'testing'), (500, 'oldstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.9.0-3-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), LANGUAGE=en_GB:en (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

qemu-user-static depends on no packages.

Versions of packages qemu-user-static recommends:
ii  binfmt-support  2.1.6-2

Versions of packages qemu-user-static suggests:
ii  sudo  1.8.19p1-2.1

-- no debconf information



Information forwarded to debian-bugs-dist@lists.debian.org, Debian QEMU Team <pkg-qemu-devel@lists.alioth.debian.org>:
Bug#868030; Package qemu-user-static. (Mon, 17 Jul 2017 18:57:06 GMT) (full text, mbox, link).


Acknowledgement sent to Dan Nicholson <nicholson@endlessm.com>:
Extra info received and forwarded to list. Copy sent to Debian QEMU Team <pkg-qemu-devel@lists.alioth.debian.org>. (Mon, 17 Jul 2017 18:57:06 GMT) (full text, mbox, link).


Message #10 received at 868030@bugs.debian.org (full text, mbox, reply):

From: Dan Nicholson <nicholson@endlessm.com>
To: 868030@bugs.debian.org
Subject: Re: qemu-user-static: Please enable "F - fix binary" flag for binfmt entries
Date: Mon, 17 Jul 2017 13:54:55 -0500
[Message part 1 (text/plain, inline)]
Attached debdiff makes use of the --fix-binary option added in
binfmt-support 2.1.7, which sets the "F" flag in the binfmt entry. I
tested this on amd64 stretch (with binfmt-support-2.1.7-1 from sid). I
created a chroot with debootstrap --arch=armhf and then chrooted into
it. It worked correctly and I was able to run the armhf binaries with
no changes besides installing qemu-user-static.

I left qemu-user-binfmt without the --fix-binary flag since it seems
unlikely that would work as well with dynamic linking and shared
libraries. It can easily be changed to require binfmt-support 2.1.7 in
both cases and pass --fix-binary unconditionally.

--
Dan
[fix-binary.patch (text/x-patch, attachment)]

Added tag(s) patch. Request was from Dan Nicholson <nicholson@endlessm.com> to control@bugs.debian.org. (Mon, 17 Jul 2017 18:57:07 GMT) (full text, mbox, link).


Information forwarded to debian-bugs-dist@lists.debian.org, Debian QEMU Team <pkg-qemu-devel@lists.alioth.debian.org>:
Bug#868030; Package qemu-user-static. (Mon, 11 Dec 2017 19:42:02 GMT) (full text, mbox, link).


Acknowledgement sent to Dan Nicholson <nicholson.db@gmail.com>:
Extra info received and forwarded to list. Copy sent to Debian QEMU Team <pkg-qemu-devel@lists.alioth.debian.org>. (Mon, 11 Dec 2017 19:42:03 GMT) (full text, mbox, link).


Message #17 received at 868030@bugs.debian.org (full text, mbox, reply):

From: Dan Nicholson <nicholson.db@gmail.com>
To: 868030@bugs.debian.org
Subject: Re: qemu-user-static: Please enable "F - fix binary" flag for binfmt entries
Date: Mon, 11 Dec 2017 13:38:48 -0600
On Mon, 17 Jul 2017 13:54:55 -0500 Dan Nicholson <nicholson@endlessm.com
> wrote:
> Attached debdiff makes use of the --fix-binary option added in
> binfmt-support 2.1.7, which sets the "F" flag in the binfmt entry. I
> tested this on amd64 stretch (with binfmt-support-2.1.7-1 from sid). I
> created a chroot with debootstrap --arch=armhf and then chrooted into
> it. It worked correctly and I was able to run the armhf binaries with
> no changes besides installing qemu-user-static.
> 
> I left qemu-user-binfmt without the --fix-binary flag since it seems
> unlikely that would work as well with dynamic linking and shared
> libraries. It can easily be changed to require binfmt-support 2.1.7 in
> both cases and pass --fix-binary unconditionally.

Ping. Anything needed here? It would be really nice to have this in as
it would make qemu-user-static much more usable out of the box.

--
Dan



Information forwarded to debian-bugs-dist@lists.debian.org, Debian QEMU Team <pkg-qemu-devel@lists.alioth.debian.org>:
Bug#868030; Package qemu-user-static. (Wed, 28 Mar 2018 09:36:03 GMT) (full text, mbox, link).


Acknowledgement sent to Corentin Noël <corentin.noel@collabora.com>:
Extra info received and forwarded to list. Copy sent to Debian QEMU Team <pkg-qemu-devel@lists.alioth.debian.org>. (Wed, 28 Mar 2018 09:36:03 GMT) (full text, mbox, link).


Message #22 received at 868030@bugs.debian.org (full text, mbox, reply):

From: Corentin Noël <corentin.noel@collabora.com>
To: 868030@bugs.debian.org
Subject: Re: qemu-user-static: Please enable "F - fix binary" flag for binfmt entries
Date: Wed, 28 Mar 2018 10:33:36 +0100
This issues now starts to have impacts in some other places in the
system.
For instance, GNOME Builder needs this flag to correctly use QEMU as
foreign-architecture emulation

see commit:
https://gitlab.gnome.org/GNOME/gnome-builder/commit/b393427b86786934610
0302f2eab6bb26a7c1f7e

Thanks

On Tue, 11 Jul 2017 11:46:25 +0100 Ian Campbell <ijc@debian.org> wrote:
> Package: qemu-user-static
> Version: 1:2.8+dfsg-6
> Severity: wishlist
> 
> Dear Maintainer,
> 
> Please consider enabling the "F" flag in the binfmt entries which
this package
> adds. From https://www.kernel.org/doc/html/v4.12/admin-guide/binfmt-m
isc.html:
> 
> F - fix binary
> 
>     The usual behaviour of binfmt_misc is to spawn the binary lazily
when the
>     misc format file is invoked. However, this doesn``t work very
well in the face
>     of mount namespaces and changeroots, so the F mode opens the
binary as soon as
>     the emulation is installed and uses the opened image to spawn the
emulator,
>     meaning it is always available once installed, regardless of how
the
>     environment changes.
> 
> This is useful because it avoids the need to bind mount the qemu-
user-static
> binaries into the container/chroot/whatever.
> 
> The documentation entry appears to have been added in Linux v4.8-rc1
so I
> pressume the feature was present at some point before then and is in
any case
> available in the 4.9 kernel used by Stretch, so enabling this in the
Buster
> onwards versions of this package ought to be reasonable I think.
> 
> I'm not sure if this also applies to the qemu-user-binfmt package,
that's
> dynamically linked and I confess I'm not sure how that works WRT
chroots and
> such.
> 
> Thanks,
> Ian.
> 
> -- System Information:
> Debian Release: 9.0
>   APT prefers stable
>   APT policy: (990, 'stable'), (500, 'oldstable-updates'), (500,
'unstable'), (500, 'testing'), (500, 'oldstable'), (1, 'experimental')
> Architecture: amd64 (x86_64)
> Foreign Architectures: i386
> 
> Kernel: Linux 4.9.0-3-amd64 (SMP w/4 CPU cores)
> Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8),
LANGUAGE=en_GB:en (charmap=UTF-8)
> Shell: /bin/sh linked to /bin/dash
> Init: systemd (via /run/systemd/system)
> 
> qemu-user-static depends on no packages.
> 
> Versions of packages qemu-user-static recommends:
> ii  binfmt-support  2.1.6-2
> 
> Versions of packages qemu-user-static suggests:
> ii  sudo  1.8.19p1-2.1
> 
> -- no debconf information
> 
> 



Reply sent to Michael Tokarev <mjt@tls.msk.ru>:
You have taken responsibility. (Thu, 12 Apr 2018 17:09:16 GMT) (full text, mbox, link).


Notification sent to Ian Campbell <ijc@debian.org>:
Bug acknowledged by developer. (Thu, 12 Apr 2018 17:09:16 GMT) (full text, mbox, link).


Message #27 received at 868030-close@bugs.debian.org (full text, mbox, reply):

From: Michael Tokarev <mjt@tls.msk.ru>
To: 868030-close@bugs.debian.org
Subject: Bug#868030: fixed in qemu 1:2.12~rc3+dfsg-1
Date: Thu, 12 Apr 2018 17:06:30 +0000
Source: qemu
Source-Version: 1:2.12~rc3+dfsg-1

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 868030@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Michael Tokarev <mjt@tls.msk.ru> (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 ftpmaster@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Thu, 12 Apr 2018 19:04:03 +0300
Source: qemu
Binary: qemu qemu-system qemu-block-extra qemu-system-common qemu-system-misc qemu-system-arm qemu-system-mips qemu-system-ppc qemu-system-sparc qemu-system-x86 qemu-user qemu-user-static qemu-user-binfmt qemu-utils qemu-guest-agent qemu-kvm
Architecture: source
Version: 1:2.12~rc3+dfsg-1
Distribution: unstable
Urgency: medium
Maintainer: Debian QEMU Team <pkg-qemu-devel@lists.alioth.debian.org>
Changed-By: Michael Tokarev <mjt@tls.msk.ru>
Description:
 qemu       - fast processor emulator, dummy package
 qemu-block-extra - extra block backend modules for qemu-system and qemu-utils
 qemu-guest-agent - Guest-side qemu-system agent
 qemu-kvm   - QEMU Full virtualization on x86 hardware
 qemu-system - QEMU full system emulation binaries
 qemu-system-arm - QEMU full system emulation binaries (arm)
 qemu-system-common - QEMU full system emulation binaries (common files)
 qemu-system-mips - QEMU full system emulation binaries (mips)
 qemu-system-misc - QEMU full system emulation binaries (miscellaneous)
 qemu-system-ppc - QEMU full system emulation binaries (ppc)
 qemu-system-sparc - QEMU full system emulation binaries (sparc)
 qemu-system-x86 - QEMU full system emulation binaries (x86)
 qemu-user  - QEMU user mode emulation binaries
 qemu-user-binfmt - QEMU user mode binfmt registration for qemu-user
 qemu-user-static - QEMU user mode emulation binaries (static version)
 qemu-utils - QEMU utilities
Closes: 839695 851694 854959 860822 868030 872098 879193 879532 879534 879536 882136 884806 886532 886671 887207 887392 887892 891261 891375 892041 892497 892947 893767 894852
Changes:
 qemu (1:2.12~rc3+dfsg-1) unstable; urgency=medium
 .
   * new upstream 2.12 release (Release Candidate 3)
     Closes: #892041, CVE-2018-7550
     Closes: #884806, CVE-2017-15124
     Closes: #887392, CVE-2018-5683
     Closes: #892497, CVE-2018-7858
     Closes: #882136, CVE-2017-16845
     Closes: #886532, #892947, #891375, #887892, #860822, #851694
   * refresh local debian patches
   * d/rules: enable new system (hppa riscv32 riscv64) and
     user (aarch64_be xtensa xtensaeb riskc32 riscv64) targets
     Closes: #893767
   * fix d/source/options to match current reality
   * drop use-data-path.patch, upstream now has --firmwarepath= option
   * enable capstone disassembler library support
     (build-depend on libcapstone-dev)
   * debian/extract-config-opts: use tab for option / condition separator
   * qemu-block-extra: install only block modules
   * make `qemu' metapackage to be dummy, to remove it in a future release
   * do not suggest kmod, it is pointless
   * install /usr/bin/qemu-pr-helper to qemu-utils package
   * switch from sdl2 to gtk ui
     Closes: #839695, #886671, #879536, #879534, #879532, #879193, #894852
   * qemu-system-ppc: forgotten qemu-system-ppc64le.1 link
   * mention closing of #880582 by 2.11
   * package will built against spice 0.14, so Closes: #854959
   * check sfdisk presence in qemu-make-debian-root (Closes: #872098)
   * check mke2fs presence in qemu-make-debian-root (Closes: #887207)
   * debian/binfmt-update-in: include forgotten hppa (Closes: #891261)
   * debian/TODO: removed some old ToDo items
   * use binfmt-support --fix-binary option (Closes: #868030)
Checksums-Sha1:
 f77a07f3b320534b49e44a492aa93ffe2d4597d3 5735 qemu_2.12~rc3+dfsg-1.dsc
 b1767b8dcc008005324701715d7c1a7417f07269 8162584 qemu_2.12~rc3+dfsg.orig.tar.xz
 efd0f0bbba4c380fca866f84c541e0ae81a19f0b 70040 qemu_2.12~rc3+dfsg-1.debian.tar.xz
 1903f5c923fd5ac881d197f0e0d0124b174f2589 15374 qemu_2.12~rc3+dfsg-1_source.buildinfo
Checksums-Sha256:
 a8f6ef1baf2ba84c9bf4523a27f8a5dc6c3aa1239dc30501e204449b32037bbf 5735 qemu_2.12~rc3+dfsg-1.dsc
 c9c8180421ee1b4e5891b8d9019aa2167f536e8bbd7d6f0819720f33cff065c8 8162584 qemu_2.12~rc3+dfsg.orig.tar.xz
 a716fe21f1ee0dec4b7b6cd38b43393ccec8fe2e23767da7f0219baf8cf1e4f1 70040 qemu_2.12~rc3+dfsg-1.debian.tar.xz
 9843f987d3d475b50328423b94545853c346a64de754727b4ebe5b10b2448fd7 15374 qemu_2.12~rc3+dfsg-1_source.buildinfo
Files:
 770e27784eb1fbd48ada9d01a1551078 5735 otherosfs optional qemu_2.12~rc3+dfsg-1.dsc
 6d5676f84d4d4a6a12537b33b3267a34 8162584 otherosfs optional qemu_2.12~rc3+dfsg.orig.tar.xz
 a1e214cf5f354f36e8b7ba194484e304 70040 otherosfs optional qemu_2.12~rc3+dfsg-1.debian.tar.xz
 4ffdc270915edffe0e4ed012f739e4d8 15374 otherosfs optional qemu_2.12~rc3+dfsg-1_source.buildinfo

-----BEGIN PGP SIGNATURE-----

iQFDBAEBCAAtFiEEe3O61ovnosKJMUsicBtPaxppPlkFAlrPjGQPHG1qdEB0bHMu
bXNrLnJ1AAoJEHAbT2saaT5ZkRsIALbmmqYA5S+H+TbHmj6EPAoxV+e7VawA9wL5
HtjsE3lNP05Qj+61TvCmDp7sqfoZJVGpoi9o8EoOJVwjOTJRiSzxxXRZTjvDgIIO
3yOHX1shy69zatdPrzpliJUrK9Rb92fw5Q75aIUO+OrMs/u4mYsmaOKIlZ1RXL6N
/AGcEzrAnkNpAioiceKOsv1Q9elTZlq44HCadBzZcRk9nEC3nc74fFexs8vtZsKv
mSov5xAsNff/UIZW2tYlqdRydyM8xH113dneZg7Y0jOHvw/qSgXu26p8Kzz7zFAU
JxYHx5gGH87HQcbXZlglYLdWJ+ZmkLsk7y3wHl2HP5WcFgR7yBw=
=YL4d
-----END PGP SIGNATURE-----




Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Sat, 12 May 2018 07:26:35 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Wed Jul 5 07:56:51 2023; Machine Name: bembo

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.