On Mon, Nov 28, 2016 at 11:38:03AM +0000, James Cowgill wrote:
> Package: qemu-user-static
> Version: 1:2.7+dfsg-3
> Severity: normal
> Forwarded: https://bugs.launchpad.net/qemu/+bug/1643619
>
> Hi,
>
> I am filing this because I want a Debian bug number - I have already
> forwarded it upstream and done a small amount of investigation into it.
>
> When attempting to qemu debootstrap a mips big-endian chroot,
> debootstrap fails to configure systemd. This is because netlink on
> qemu-user mips is broken - a request is made to the kernel which never
> replies.
>
> I did some investigation and it seems that the netlink requests are all
> byteswapped and the kernel ignores them (presumably because they contain
> garbage). I suspect this also affects other big-endian architectures but
> I have not checked.

Hi,
This bug has been fixed upstream[1], and I can confirm that including
this patch allows me to debootstrap a mips chroot. I have attached the
full debdiff which I used for my local package. Could this please be
fixed for stretch?

Thanks,
James
diff -Nru qemu-2.8+dfsg/debian/changelog qemu-2.8+dfsg/debian/changelog
--- qemu-2.8+dfsg/debian/changelog      2017-03-01 09:32:26.000000000 +0000
+++ qemu-2.8+dfsg/debian/changelog      2017-03-19 18:54:23.000000000 +0000
@@ -1,3 +1,11 @@
+qemu (1:2.8+dfsg-3.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Backport upstream fix for socket syscall byte swapping
+    Closes: #846084
+
+ -- James Clarke <jrt...@debian.org>  Sun, 19 Mar 2017 18:54:23 +0000
+
 qemu (1:2.8+dfsg-3) unstable; urgency=high
 
   * urgency high due to security fixes
diff -Nru 
qemu-2.8+dfsg/debian/patches/linux-user-fix-socket-syscall-byte-swap.patch 
qemu-2.8+dfsg/debian/patches/linux-user-fix-socket-syscall-byte-swap.patch
--- qemu-2.8+dfsg/debian/patches/linux-user-fix-socket-syscall-byte-swap.patch  
1970-01-01 01:00:00.000000000 +0100
+++ qemu-2.8+dfsg/debian/patches/linux-user-fix-socket-syscall-byte-swap.patch  
2017-03-19 18:54:17.000000000 +0000
@@ -0,0 +1,41 @@
+From 40493c5f2b0f124c9b2581e539bba14522e51269 Mon Sep 17 00:00:00 2001
+From: Laurent Vivier <laur...@vivier.eu>
+Date: Thu, 26 Jan 2017 09:04:48 +0100
+Subject: [PATCH] linux-user: fix "apt-get update" on linux-user hppa
+
+apt-get was hanging on linux-user hppa.
+
+strace has shown the netlink data stream was not correctly byte swapped.
+
+It appears the fd translator function is unregistered just after it
+has been registered, so the translator function is not called.
+
+This patch removes the fd_trans_unregister() after the do_socket()
+in the TARGET_NR_socket case.
+
+This fd_trans_unregister() was added by commit
+    e36800c linux-user: add signalfd/signalfd4 syscalls
+when do_socket() was not registering any fd translator.
+And as now it is, we must remove this fd_trans_unregister() to keep them.
+
+Reported-by: John Paul Adrian Glaubitz <glaub...@physik.fu-berlin.de>
+Signed-off-by: Laurent Vivier <laur...@vivier.eu>
+Tested-by: John Paul Adrian Glaubitz <glaub...@physik.fu-berlin.de>
+Message-Id: <20170126080449.28255-3-laur...@vivier.eu>
+Signed-off-by: Richard Henderson <r...@twiddle.net>
+---
+ linux-user/syscall.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/linux-user/syscall.c b/linux-user/syscall.c
+index 11a311f..9be8e95 100644
+--- a/linux-user/syscall.c
++++ b/linux-user/syscall.c
+@@ -9343,7 +9343,6 @@ abi_long do_syscall(void *cpu_env, int num, abi_long 
arg1,
+ #ifdef TARGET_NR_socket
+     case TARGET_NR_socket:
+         ret = do_socket(arg1, arg2, arg3);
+-        fd_trans_unregister(ret);
+         break;
+ #endif
+ #ifdef TARGET_NR_socketpair
diff -Nru qemu-2.8+dfsg/debian/patches/series 
qemu-2.8+dfsg/debian/patches/series
--- qemu-2.8+dfsg/debian/patches/series 2017-03-01 09:05:15.000000000 +0000
+++ qemu-2.8+dfsg/debian/patches/series 2017-03-19 18:54:23.000000000 +0000
@@ -27,3 +27,4 @@
 virtio-gpu-fix-resource-leak-in-virgl_cmd_resource-CVE-2017-5857.patch
 cirrus-fix-oob-access-issue-CVE-2017-2615.patch
 9pfs-symlink-attack-fixes-CVE-2016-9602.patch
+linux-user-fix-socket-syscall-byte-swap.patch

Reply via email to