qemu: prevent possible crash when using security_model=mapped-file

When security_model=mapped-file is being used for VirtFS when accessing
shared storage or other file system that doesn't support chmod, an
assertion error may occur.
This commit is contained in:
Leonid Pliushch 2021-08-22 18:35:22 +03:00 committed by Yaksh Bariya
parent 7b52b1d11c
commit 00ea1595e9
No known key found for this signature in database
GPG Key ID: F7486BA7D3D27581
2 changed files with 13 additions and 1 deletions

View File

@ -0,0 +1,12 @@
diff -uNr qemu-5.2.0/hw/9pfs/9p-local.c qemu-5.2.0.mod/hw/9pfs/9p-local.c
--- qemu-5.2.0/hw/9pfs/9p-local.c 2020-12-08 18:59:44.000000000 +0200
+++ qemu-5.2.0.mod/hw/9pfs/9p-local.c 2021-08-07 17:01:43.567841976 +0300
@@ -299,8 +299,6 @@
map_fd = fileno(fp);
assert(map_fd != -1);
- ret = fchmod(map_fd, 0600);
- assert(ret == 0);
if (credp->fc_uid != -1) {
uid = credp->fc_uid;

View File

@ -3,7 +3,7 @@ TERMUX_PKG_DESCRIPTION="A generic and open source machine emulator and virtualiz
TERMUX_PKG_LICENSE="LGPL-2.1"
TERMUX_PKG_MAINTAINER="Leonid Pliushch <leonid.pliushch@gmail.com>"
TERMUX_PKG_VERSION=1:5.2.0
TERMUX_PKG_REVISION=9
TERMUX_PKG_REVISION=10
TERMUX_PKG_SRCURL=https://download.qemu.org/qemu-${TERMUX_PKG_VERSION:2}.tar.xz
TERMUX_PKG_SHA256="cb18d889b628fbe637672b0326789d9b0e3b8027e0445b936537c78549df17bc"
TERMUX_PKG_DEPENDS="attr, glib, libbz2, libc++, libcap-ng, libcurl, libgcrypt, libiconv, libjpeg-turbo, liblzo, libnfs, libpixman, libpng, libssh, libx11, ncurses, qemu-common, resolv-conf, sdl2, sdl2-image, zlib, libspice-server, libusbredir"