Debian Bug report logs - #415996
option to have qemu chroot() into the target filesystem

version graph

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

Reported by: Simon Richter <sjr@debian.org>

Date: Fri, 23 Mar 2007 19:57:08 UTC

Severity: wishlist

Found in version qemu/0.8.2-4

Fixed in version qemu/0.10.0-1

Done: Aurelien Jarno <aurel32@debian.org>

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, sjr@debian.org, Debian QEMU Team <pkg-qemu-devel@lists.alioth.debian.org>:
Bug#415996; Package qemu. (full text, mbox, link).


Acknowledgement sent to Simon Richter <sjr@debian.org>:
New Bug report received and forwarded. Copy sent to sjr@debian.org, Debian QEMU Team <pkg-qemu-devel@lists.alioth.debian.org>. (full text, mbox, link).


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

From: Simon Richter <sjr@debian.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: option to have qemu chroot() into the target filesystem
Date: Fri, 23 Mar 2007 20:40:36 +0100
Package: qemu
Version: 0.8.2-4
Severity: wishlist

Hi,

going into a chroot for a different architecture is difficult because
you either need qemu and all dependencies (or a statically linked qemu)
inside the target filesystem or a statically linked chroot command for
the target architecture that instructs qemu to chroot() into the target
filesystem.

It would be nice if qemu could perform the chroot() by itself.

   Simon

-- System Information:
Debian Release: 4.0
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing')
Architecture: amd64 (x86_64)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-4-amd64
Locale: LANG=ja_JP.UTF-8, LC_CTYPE=ja_JP.UTF-8 (charmap=UTF-8)

Versions of packages qemu depends on:
ii  bochsbios                   2.3-2        BIOS for the Bochs emulator
ii  libasound2                  1.0.13-2     ALSA library
ii  libc6                       2.3.6.ds1-13 GNU C Library: Shared libraries
ii  libncurses5                 5.5-5        Shared libraries for terminal hand
ii  libsdl1.2debian             1.2.11-8     Simple DirectMedia Layer
ii  openhackware                0.4.1-2      OpenFirmware emulator for PowerPC
ii  proll                       18-2         JavaStation PROM 2.x compatible re
ii  vgabios                     0.6a-1       VGA BIOS software for the Bochs an
ii  zlib1g                      1:1.2.3-13   compression library - runtime

Versions of packages qemu recommends:
ii  debootstrap                   0.3.3.2    Bootstrap a basic Debian system
ii  sharutils                     1:4.2.1-15 shar, unshar, uuencode, uudecode
pn  vde                           <none>     (no description available)

-- no debconf information



Information forwarded to debian-bugs-dist@lists.debian.org, Debian QEMU Team <pkg-qemu-devel@lists.alioth.debian.org>:
Bug#415996; Package qemu. (Fri, 24 Oct 2008 09:42:19 GMT) (full text, mbox, link).


Acknowledgement sent to Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>:
Extra info received and forwarded to list. Copy sent to Debian QEMU Team <pkg-qemu-devel@lists.alioth.debian.org>. (Fri, 24 Oct 2008 09:42:19 GMT) (full text, mbox, link).


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

From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
To: 415996@bugs.debian.org
Cc: rob@landley.net
Subject: Re: option to have qemu chroot() into the target filesystem
Date: Fri, 24 Oct 2008 11:21:29 +0200
A patch was in this thread:
http://www.mail-archive.com/qemu-devel@nongnu.org/msg16297.html

Rob promised to respin it tomorrow and resend it in to the list.
thanks




Information forwarded to debian-bugs-dist@lists.debian.org, Debian QEMU Team <pkg-qemu-devel@lists.alioth.debian.org>:
Bug#415996; Package qemu. (Fri, 24 Oct 2008 23:06:02 GMT) (full text, mbox, link).


Acknowledgement sent to Rob Landley <rob@landley.net>:
Extra info received and forwarded to list. Copy sent to Debian QEMU Team <pkg-qemu-devel@lists.alioth.debian.org>. (Fri, 24 Oct 2008 23:06:02 GMT) (full text, mbox, link).


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

From: Rob Landley <rob@landley.net>
To: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Cc: 415996@bugs.debian.org, qemu-devel@nongnu.org
Subject: [PATCH] Re: option to have qemu chroot() into the target filesystem
Date: Fri, 24 Oct 2008 18:06:10 -0500
[Message part 1 (text/plain, inline)]
On Friday 24 October 2008 04:21:29 Bernhard Reutner-Fischer wrote:
> A patch was in this thread:
> http://www.mail-archive.com/qemu-devel@nongnu.org/msg16297.html
>
> Rob promised to respin it tomorrow and resend it in to the list.
> thanks

The debian bug report in question is:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=415996

I checked and the old patch still applies cleanly (well, with an offset, but 
no fuzz).  I applied it and then did an svn diff, the result of which is 
attached.  (As with all svn diffs, it applies with "patch -p0 -i blah.patch")

It's actually a very simple patch, which does this:

A) Teach qemu-$TARGET to do a chdir() plus chroot() in response to a -chroot 
command line option.

B) Because A) requires root access, teach qemu-$TARGET to change uid and gid 
via a -su option (and set both the real and effective user IDs so it's 
actually dropping priviledges).

C) Add error handling if any of the above fails.  (I.E. I check the return 
code so that if you _don't _drop privs I'm not introducing a security hole.)

D) Add help text entries describing the new options.

The only objection to the original patch was that there's one case it doesn't 
cover; if the emulated process does an "exec" of another target binary, qemu 
doesn't handle that:
http://www.mail-archive.com/qemu-devel%40nongnu.org/msg16496.html

In my opinion this boils down to "qemu doesn't do something before this patch, 
and still doesn't do it afterwards either".  That's really a separate issue, 
which can be addressed later if necessary.

Rob

P.S.  I note that I did _not_ check to make sure that "qemu-arm -su" actually 
has an argument after it to avoid a segfault, but 
then "qemu-arm -cpu", "qemu-arm -s", "qemu-arm -g"  and so on all segfault in 
exactly the same way, so that's another separate issue if anybody cares.
[chroot2.patch (text/x-diff, attachment)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian QEMU Team <pkg-qemu-devel@lists.alioth.debian.org>:
Bug#415996; Package qemu. (Sat, 25 Oct 2008 08:12:02 GMT) (full text, mbox, link).


Acknowledgement sent to "Blue Swirl" <blauwirbel@gmail.com>:
Extra info received and forwarded to list. Copy sent to Debian QEMU Team <pkg-qemu-devel@lists.alioth.debian.org>. (Sat, 25 Oct 2008 08:12:02 GMT) (full text, mbox, link).


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

From: "Blue Swirl" <blauwirbel@gmail.com>
To: qemu-devel@nongnu.org
Cc: "Bernhard Reutner-Fischer" <rep.dot.nop@gmail.com>, 415996@bugs.debian.org
Subject: Re: [Qemu-devel] [PATCH] Re: option to have qemu chroot() into the target filesystem
Date: Sat, 25 Oct 2008 11:09:58 +0300
On 10/25/08, Rob Landley <rob@landley.net> wrote:
> On Friday 24 October 2008 04:21:29 Bernhard Reutner-Fischer wrote:
>  > A patch was in this thread:
>  > http://www.mail-archive.com/qemu-devel@nongnu.org/msg16297.html
>  >
>  > Rob promised to respin it tomorrow and resend it in to the list.
>  > thanks
>
>  The debian bug report in question is:
>  http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=415996
>
>  I checked and the old patch still applies cleanly (well, with an offset, but
>  no fuzz).  I applied it and then did an svn diff, the result of which is
>  attached.  (As with all svn diffs, it applies with "patch -p0 -i blah.patch")
>
>  It's actually a very simple patch, which does this:
>
>  A) Teach qemu-$TARGET to do a chdir() plus chroot() in response to a -chroot
>  command line option.
>
>  B) Because A) requires root access, teach qemu-$TARGET to change uid and gid
>  via a -su option (and set both the real and effective user IDs so it's
>  actually dropping priviledges).

Because the UID change happens at argument parse stage, doesn't the
chrooting fail if the -su option is specified in the command line
before -chroot?




Tags added: pending Request was from Aurelien Jarno <aurel32@alioth.debian.org> to control@bugs.debian.org. (Fri, 27 Feb 2009 23:42:03 GMT) (full text, mbox, link).


Reply sent to Aurelien Jarno <aurel32@debian.org>:
You have taken responsibility. (Sat, 07 Mar 2009 15:12:12 GMT) (full text, mbox, link).


Notification sent to Simon Richter <sjr@debian.org>:
Bug acknowledged by developer. (Sat, 07 Mar 2009 15:12:12 GMT) (full text, mbox, link).


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

From: Aurelien Jarno <aurel32@debian.org>
To: 415996-close@bugs.debian.org
Subject: Bug#415996: fixed in qemu 0.10.0-1
Date: Sat, 07 Mar 2009 15:03:18 +0000
Source: qemu
Source-Version: 0.10.0-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:

libqemu-dev_0.10.0-1_amd64.deb
  to pool/main/q/qemu/libqemu-dev_0.10.0-1_amd64.deb
qemu_0.10.0-1.diff.gz
  to pool/main/q/qemu/qemu_0.10.0-1.diff.gz
qemu_0.10.0-1.dsc
  to pool/main/q/qemu/qemu_0.10.0-1.dsc
qemu_0.10.0-1_amd64.deb
  to pool/main/q/qemu/qemu_0.10.0-1_amd64.deb
qemu_0.10.0.orig.tar.gz
  to pool/main/q/qemu/qemu_0.10.0.orig.tar.gz



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

Debian distribution maintenance software
pp.
Aurelien Jarno <aurel32@debian.org> (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@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Sat, 07 Mar 2009 06:20:34 +0100
Source: qemu
Binary: qemu libqemu-dev
Architecture: source amd64
Version: 0.10.0-1
Distribution: unstable
Urgency: low
Maintainer: Debian QEMU Team <pkg-qemu-devel@lists.alioth.debian.org>
Changed-By: Aurelien Jarno <aurel32@debian.org>
Description: 
 libqemu-dev - static libraries and headers for QEMU
 qemu       - fast processor emulator
Closes: 297572 415996 470231 474386 501731 513210 514462
Changes: 
 qemu (0.10.0-1) unstable; urgency=low
 .
   [ Aurelien Jarno ]
   * New upstream release:
     - Fix fr-be keyboard mapping (closes: bug#514462).
     - Fix stat64 structure on ppc-linux-user (closes: bug#470231).
     - Add a chroot option (closes: bug#415996).
     - Add evdev support (closes: bug#513210).
     - Fix loop on symlinks in user mode (closes: bug#297572).
     - Bump depends on openbios-sparc.
     - Depends on openbios-ppc.
     - Update 12_signal_powerpc_support.patch.
     - Update 21_net_soopts.patch.
     - Drop 44_socklen_t_check.patch (merged upstream).
     - Drop 49_null_check.patch (merged upstream).
     - Update 64_ppc_asm_constraints.patch.
     - Drop security/CVE-2008-0928-fedora.patch (merged upstream).
     - Drop security/CVE-2007-5730.patch (merged upstream).
   * patches/80_stable-branch.patch: add patches from stable branch:
     - Fix race condition between signal handler/execution loop (closes:
       bug#474386, bug#501731).
   * debian/copyright: update.
   * Compile and install .dtb files:
     - debian/control: build-depends on device-tree-compiler.
     - debian/patches/81_compile_dtb.patch: new patch from upstream.
     - debian/rules: compile and install bamboo.dtb and mpc8544.dtb.
Checksums-Sha1: 
 443458b95774ba1c39c1dfdab54796b9b0814171 1751 qemu_0.10.0-1.dsc
 a2dc91ffb9fcb4ace600d93b7af505f362406c57 3099378 qemu_0.10.0.orig.tar.gz
 f29f973e62d6bdc1b31c8c3241891cdf693732ee 40132 qemu_0.10.0-1.diff.gz
 781e129b6559f13f0ff4e5524a2712c23ea8b4ac 15809820 qemu_0.10.0-1_amd64.deb
 423289fcad667b91d155205ab405b0c84e070a2a 4830344 libqemu-dev_0.10.0-1_amd64.deb
Checksums-Sha256: 
 e2b063b12c8d835a548fd96ee21c838fe52fd1150e7b9561294162e1c9945946 1751 qemu_0.10.0-1.dsc
 092c7d75a457f3e9f8b3d994f1976b8dd91b3c3d7bfe2ce2c5a6dd8fbb1a8ada 3099378 qemu_0.10.0.orig.tar.gz
 e2974feba5e328c3712f82d00a14ae02743540a5884e3cf07acf23c1d0fe1d46 40132 qemu_0.10.0-1.diff.gz
 88d52066a2e7d42875bb385df9167f48538bd53ae685eaf0c6173e6a392326a4 15809820 qemu_0.10.0-1_amd64.deb
 33a92d138812a7f948d38685c3ec16ff8ce79d1506781f22ccd06129f6f1d94a 4830344 libqemu-dev_0.10.0-1_amd64.deb
Files: 
 a7a8b5154436379a1ac9a2e53c9797f3 1751 misc optional qemu_0.10.0-1.dsc
 5d00d032201671c45c23fdebfec0c4aa 3099378 misc optional qemu_0.10.0.orig.tar.gz
 e2d7598c445a25356ced6f6f920c589c 40132 misc optional qemu_0.10.0-1.diff.gz
 1eba95ded798ff1435cbd205e8bb5d9f 15809820 misc optional qemu_0.10.0-1_amd64.deb
 45ce31d3acd78dc66fea4f2086becb41 4830344 libdevel optional libqemu-dev_0.10.0-1_amd64.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iD8DBQFJsoEow3ao2vG823MRAhh8AJ4xn9tGuUPjMxHWJodNx2wGvT17HQCePzH+
IrJuBkNFKNjz5lHw3RbwNyU=
=mfE1
-----END PGP SIGNATURE-----





Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Tue, 07 Apr 2009 07:37:22 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: Fri Nov 24 18:16:22 2023; Machine Name: buxtehude

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.