Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qemu: 5.1.0 -> 5.2.0 #106988

Merged
merged 1 commit into from
Jan 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 0 additions & 43 deletions pkgs/applications/virtualization/qemu/CVE-2020-27617.patch

This file was deleted.

38 changes: 12 additions & 26 deletions pkgs/applications/virtualization/qemu/default.nix
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{ lib, stdenv, fetchurl, fetchpatch, python, zlib, pkg-config, glib
, perl, pixman, vde2, alsaLib, texinfo, flex
, bison, lzo, snappy, libaio, gnutls, nettle, curl
, makeWrapper
, bison, lzo, snappy, libaio, gnutls, nettle, curl, ninja, meson
, makeWrapper, autoPatchelfHook
, attr, libcap, libcap_ng
, CoreServices, Cocoa, Hypervisor, rez, setfile
, numaSupport ? stdenv.isLinux && !stdenv.isAarch32, numactl
, seccompSupport ? stdenv.isLinux, libseccomp
, alsaSupport ? lib.hasSuffix "linux" stdenv.hostPlatform.system && !nixosTestRunner
, pulseSupport ? !stdenv.isDarwin && !nixosTestRunner, libpulseaudio
, sdlSupport ? !stdenv.isDarwin && !nixosTestRunner, SDL2
, sdlSupport ? !stdenv.isDarwin && !nixosTestRunner, SDL2, SDL2_image
, gtkSupport ? !stdenv.isDarwin && !xenSupport && !nixosTestRunner, gtk3, gettext, vte, wrapGAppsHook
, vncSupport ? !nixosTestRunner, libjpeg, libpng
, smartcardSupport ? !nixosTestRunner, libcacard
Expand Down Expand Up @@ -39,18 +39,18 @@ let
in

stdenv.mkDerivation rec {
version = "5.1.0";
version = "5.2.0";
pname = "qemu"
+ lib.optionalString xenSupport "-xen"
+ lib.optionalString hostCpuOnly "-host-cpu-only"
+ lib.optionalString nixosTestRunner "-for-vm-tests";

src = fetchurl {
url= "https://download.qemu.org/qemu-${version}.tar.xz";
sha256 = "1rd41wwlvp0vpialjp2czs6i3lsc338xc72l3zkbb7ixjfslw5y9";
sha256 = "1g0pvx4qbirpcn9mni704y03n3lvkmw2c0rbcwvydyr8ns4xh66b";
};

nativeBuildInputs = [ python python.pkgs.sphinx pkg-config flex bison ]
nativeBuildInputs = [ python python.pkgs.sphinx pkg-config flex bison meson ninja autoPatchelfHook ]
++ optionals gtkSupport [ wrapGAppsHook ];
buildInputs =
[ zlib glib perl pixman
Expand All @@ -62,7 +62,7 @@ stdenv.mkDerivation rec {
++ optionals seccompSupport [ libseccomp ]
++ optionals numaSupport [ numactl ]
++ optionals pulseSupport [ libpulseaudio ]
++ optionals sdlSupport [ SDL2 ]
++ optionals sdlSupport [ SDL2 SDL2_image ]
++ optionals gtkSupport [ gtk3 gettext vte ]
++ optionals vncSupport [ libjpeg libpng ]
++ optionals smartcardSupport [ libcacard ]
Expand All @@ -77,20 +77,13 @@ stdenv.mkDerivation rec {
++ optionals smbdSupport [ samba ];

enableParallelBuilding = true;
dontUseMesonConfigure = true; # meson's configurePhase isn't compatible with qemu build

outputs = [ "out" "ga" ];

patches = [
./no-etc-install.patch
./fix-qemu-ga.patch
./9p-ignore-noatime.patch
./CVE-2020-27617.patch
(fetchpatch {
# e1000e: infinite loop scenario in case of null packet descriptor, remove for QEMU >= 5.2.0-rc3
name = "CVE-2020-28916.patch";
url = "https://git.qemu.org/?p=qemu.git;a=patch;h=c2cb511634012344e3d0fe49a037a33b12d8a98a";
sha256 = "1kvm6wl4vry0npiisxsn76h8nf1iv5fmqsyjvb46203f1yyg5pis";
})
] ++ optional nixosTestRunner ./force-uid0-on-9p.patch
++ optionals stdenv.hostPlatform.isMusl [
(fetchpatch {
Expand All @@ -108,27 +101,19 @@ stdenv.mkDerivation rec {
})
];

# Remove CVE-2020-{29129,29130} for QEMU >5.1.0
postPatch = ''
(cd slirp && patch -p1 < ${fetchpatch {
name = "CVE-2020-29129_CVE-2020-29130.patch";
url = "https://gitlab.freedesktop.org/slirp/libslirp/-/commit/2e1dcbc0c2af64fcb17009eaf2ceedd81be2b27f.patch";
sha256 = "01vbjqgnc0kp881l5p6b31cyyirhwhavm6x36hlgkymswvl3wh9w";
}})
'';

hardeningDisable = [ "stackprotector" ];

preConfigure = ''
unset CPP # intereferes with dependency calculation
# this script isn't marked as executable b/c it's indirectly used by meson. Needed to patch its shebang
chmod +x ./scripts/shaderinclude.pl
patchShebangs .
'' + optionalString stdenv.hostPlatform.isMusl ''
NIX_CFLAGS_COMPILE+=" -D_LINUX_SYSINFO_H"
'';

configureFlags =
[ "--audio-drv-list=${audio}"
"--sysconfdir=/etc"
"--localstatedir=/var"
"--enable-docs"
"--enable-tools"
"--enable-guest-agent"
Expand Down Expand Up @@ -169,6 +154,7 @@ stdenv.mkDerivation rec {
wrapGApp $f
done
'';
preBuild = "cd build";

# Add a ‘qemu-kvm’ wrapper for compatibility/convenience.
postInstall = ''
Expand Down
12 changes: 0 additions & 12 deletions pkgs/applications/virtualization/qemu/no-etc-install.patch

This file was deleted.