case "$QEMU_OPTS" in *--enable-vnc*)
- suggest_depends gnutls \
- "--enable-gnutls" \
- "--disable-gnutls" \
- "to enable TLS encryption for VNC server" &&
-
- case "$QEMU_VNC_TLS" in
- nettle)
- depends nettle '--enable-nettle --disable-gcrypt' ;;
- gcrypt)
- depends libgcrypt '--enable-gcrypt --disable-nettle' ;;
- esac
+ # In QEMU's order of preference
+ optional_depends gnutls \
+ --{enable,disable}-gnutls \
+ 'to enable TLS encryption for VNC server using GnuTLS' &&
+ if ! is_depends_enabled "$SPELL" gnutls; then
+ optional_depends libgcrypt \
+ --{enable,disable}-gcrypt \
+ 'to enable TLS encryption for VNC server using
libgcrypt' &&
+ if ! is_depends_enabled "$SPELL" libgcrypt; then
+ optional_depends nettle \
+ --{enable,disable}-nettle \
+ 'to enable TLS encryption for VNC server using Nettle'
+ fi
+ fi &&
+
suggest_depends LIBSASL \
"--enable-vnc-sasl" \
"--disable-vnc-sasl" \
@@ -127,6 +162,22 @@ case "$QEMU_OPTS" in *--enable-vnc*)
;;
esac &&
+optional_depends capstone \
+ --{enable,disable}-capstone \
+ 'for capstone disassembler support' &&
+
+optional_depends jemalloc \
+ --{enable,disable}-jemalloc \
+ 'for jemalloc support' &&
+
+optional_depends libssh2 \
+ --{enable,disable}-libssh \
+ 'for SSH block device support' &&
+
+optional_depends DEVICE-MANAGER \
+ --{enable,disable}-libudev \
+ 'to enumerate host devices with libudev' &&
+
suggest_depends bridge-utils \
'' \
'' \
diff --git a/utils/qemu/DETAILS b/utils/qemu/DETAILS
index b0f6216..4b151ec 100755
--- a/utils/qemu/DETAILS
+++ b/utils/qemu/DETAILS
@@ -1,5 +1,5 @@
SPELL=qemu
- VERSION=5.1.0
+ VERSION=6.1.0
SOURCE=$SPELL-$VERSION.tar.bz2
SOURCE2=$SOURCE.sig
SOURCE_DIRECTORY="$BUILD_DIRECTORY/$SPELL-${VERSION%-*}"
@@ -13,7 +13,7 @@ SOURCE_DIRECTORY="$BUILD_DIRECTORY/$SPELL-${VERSION%-*}"
WEB_SITE=http://qemu.org/
KEYWORDS="emulator utils"
ENTERED=20051102
- SECURITY_PATCH=1
+ SECURITY_PATCH=2
TMPFS=OFF
SHORT="generic and open source processor emulator"
cat << EOF
diff --git a/utils/qemu/HISTORY b/utils/qemu/HISTORY
index 14246dd..a497835 100644
--- a/utils/qemu/HISTORY
+++ b/utils/qemu/HISTORY
@@ -1,3 +1,23 @@
+2021-09-10 Ismael Luceno <ismael AT sourcemage.org>
+ * DETAILS: updated spell to 6.1.0
+ * DEPENDS: on musl hosts request musl 1.2.2+ (sigevent API)
+ added meson and ninja-build-system
+ added optional deps on: DEVICE-MANAGER, capstone, fuse3, jemalloc,
+ libssh2, libxml2, lzfse, sdl2_image, and zstd
+ fixed flags for snappy
+ * CONFIGURE, DEPENDS: reworked TLS library dependencies
+ * BUILD: added removal of -ffast-math from CFLAGS
+ added --disable-fuse for musl
+ * archs: added avr; removed lm32, moxie, tilegx and unicore32
+ * patches/musl-F_SHLCK-and-F_EXLCK.patch,
+ patches/musl-fix-duplicated-sysinfo.patch,
+ patches/musl-fix-sigevent-and-sigval_t.patch: removed, no longer
needed
+ *
patches/0006-linux-user-signal.c-define-__SIGRTMIN-MAX-for-non-GN.patch,
+ patches/mmap-mremap-efault.patch: updated for 6.1.0
+ * patches/musl-initialize-msghdr.patch: added to fix sendmsg syscall
emulation
+ * patches/CVE-2021-20255.patch: added security fix
+ * DETAILS: SECURITY_PATCH++
+
2021-09-09 Ismael Luceno <ismael AT sourcemage.org>
* patches/musl-fix-duplicated-sysinfo.patch: fixed for glibc
* CONFIGURE: added sanitization of QEMU_ARCHS
diff --git a/utils/qemu/archs b/utils/qemu/archs
index 5db6b88..c6c70fa 100644
--- a/utils/qemu/archs
+++ b/utils/qemu/archs
@@ -6,13 +6,13 @@ alpha-softmmu alpha on
arm-linux-user arm-user on
arm-softmmu arm on
armeb-linux-user armeb-user on
+avr-softmmu avr on
cris-linux-user cris-user on
cris-softmmu cris on
hppa-linux-user hppa-user on
hppa-softmmu hppa on
i386-linux-user i386-user on
i386-softmmu i386 on
-lm32-softmmu lm32 on
m68k-linux-user m68k-user on
m68k-softmmu m68k on
microblaze-linux-user microblaze-user on
@@ -29,7 +29,6 @@ mipsel-linux-user mipsel-user on
mipsel-softmmu mipsel on
mipsn32-linux-user mipsn32-user on
mipsn32el-linux-user mipsn32el-user on
-moxie-softmmu moxie on
nios2-linux-user nios2-user on
nios2-softmmu nios2 on
or1k-linux-user or1k-user on
@@ -55,9 +54,7 @@ sparc-softmmu sparc on
sparc32plus-linux-user sparc32plus-user on
sparc64-linux-user sparc64-user on
sparc64-softmmu sparc64 on
-tilegx-linux-user tilegx-user on
tricore-softmmu tricore on
-unicore32-softmmu unicore32 on
x86_64-linux-user x86_64-user on
x86_64-softmmu x86_64 on
xtensa-linux-user xtensa-user on
diff --git
a/utils/qemu/patches/0006-linux-user-signal.c-define-__SIGRTMIN-MAX-for-non-GN.patch
b/utils/qemu/patches/0006-linux-user-signal.c-define-__SIGRTMIN-MAX-for-non-GN.patch
index e434b23..4c792b0 100644
---
a/utils/qemu/patches/0006-linux-user-signal.c-define-__SIGRTMIN-MAX-for-non-GN.patch
+++
b/utils/qemu/patches/0006-linux-user-signal.c-define-__SIGRTMIN-MAX-for-non-GN.patch
@@ -1,5 +1,22 @@
-Updated version of
0006-linux-user-signal.c-define-__SIGRTMIN-MAX-for-non-GN.patch for qemu-3.0.0
-from alpine, original author Natanael Copa.
+From 8fbb4e6797ed67310b74cbaaa061269db45a5b71 Mon Sep 17 00:00:00 2001
+From: Natanael Copa <ncopa AT alpinelinux.org>
+Date: Tue, 29 Apr 2014 15:51:31 +0200
+Subject: [PATCH] linux-user/signal.c: define __SIGRTMIN/MAX for non-GNU
+ platforms
+
+The __SIGRTMIN and __SIGRTMAX are glibc internals and are not available
+on all platforms, so we define those if they are missing.
+
+This is needed for musl libc.
+
+Signed-off-by: Natanael Copa <ncopa AT alpinelinux.org>
+Origin: Alpine Linux
+---
+ linux-user/signal.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/linux-user/signal.c b/linux-user/signal.c
+index 5ca6d62b15..e917c16d91 100644
--- a/linux-user/signal.c
+++ b/linux-user/signal.c
@@ -25,6 +25,13 @@
@@ -16,3 +33,6 @@ from alpine, original author Natanael Copa.
static struct target_sigaction sigact_table[TARGET_NSIG];
static void host_signal_handler(int host_signum, siginfo_t *info,
+--
+2.23.0
+
diff --git a/utils/qemu/patches/CVE-2021-20255.patch
b/utils/qemu/patches/CVE-2021-20255.patch
new file mode 100644
index 0000000..9b9984d
--- /dev/null
+++ b/utils/qemu/patches/CVE-2021-20255.patch
@@ -0,0 +1,44 @@
+CVE-2021-20255 patch adapted from QEMU patch by Stefan Weil
+
+Link: https://bugzilla.redhat.com/show_bug.cgi?id=1930646
+
+Signed-off-by: Neha Agarwal <nehaagarwal AT microsoft.com>
+Origin: Alpine Linux
+---
+diff --git a/hw/net/eepro100.c b/hw/net/eepro100.c
+index 16e95ef9cc..2474cf3dc2 100644
+--- a/hw/net/eepro100.c
++++ b/hw/net/eepro100.c
+@@ -279,6 +279,9 @@ typedef struct {
+ /* Quasi static device properties (no need to save them). */
+ uint16_t stats_size;
+ bool has_extended_tcb_support;
++
++ /* Flag to avoid recursions. */
++ bool busy;
+ } EEPRO100State;
+
+ /* Word indices in EEPROM. */
+@@ -837,6 +840,14 @@ static void action_command(EEPRO100State *s)
+ Therefore we limit the number of iterations. */
+ unsigned max_loop_count = 16;
+
++ if (s->busy) {
++ /* Prevent recursions. */
++ logout("recursion in %s:%u\n", __FILE__, __LINE__);
++ return;
++ }
++
++ s->busy = true;
++
+ for (;;) {
+ bool bit_el;
+ bool bit_s;
+@@ -933,6 +944,7 @@ static void action_command(EEPRO100State *s)
+ }
+ TRACE(OTHER, logout("CU list empty\n"));
+ /* List is empty. Now CU is idle or suspended. */
++ s->busy = false;
+ }
+
+ static void eepro100_cu_command(EEPRO100State * s, uint8_t val)
diff --git a/utils/qemu/patches/mmap-mremap-efault.patch
b/utils/qemu/patches/mmap-mremap-efault.patch
index b033d23..0127543 100644
--- a/utils/qemu/patches/mmap-mremap-efault.patch
+++ b/utils/qemu/patches/mmap-mremap-efault.patch
@@ -1,24 +1,33 @@
-Source: @pullmoll
-Upstream: no
-Reason: errno=EFAULT when the address passed to mremap(2) is not valid
+From da39a3ee5e6b4b0d3255bfef95601890afd80709 Mon Sep 17 00:00:00 2001
+From: Jürgen Buchmüller <pullmoll AT t-online.de>
+Subject: [PATCH] linux-user: Return errno=EFAULT on invalid address to mremap
-See Rich Felker's comment at https://www.openwall.com/lists/musl/2017/06/21/2 for
-why we need to return errno as described in man mremap(2) from
qemu-user-static.
Also speed up the loop when checking for increasing the mappings size to go
-in steps of TARGET_PAGE_SIZE and OR-in a check for the very last byte of the
range.
+in steps of TARGET_PAGE_SIZE and OR-in a check for the very last byte of
+the range.