Skip to content

Commit

Permalink
[qemu-usermode] Update to 4.0.1. JB#45765
Browse files Browse the repository at this point in the history
  • Loading branch information
Franz-Josef Haider authored and krnlyng committed Jan 24, 2020
1 parent c3d8902 commit 4a1091e
Show file tree
Hide file tree
Showing 27 changed files with 2,103 additions and 1,069 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
@@ -0,0 +1,3 @@
[submodule "upstream"]
path = upstream
url = https://git.sailfishos.org/mirror/qemu.git
@@ -0,0 +1,64 @@
From 25ff0573a73123d71e10ec4849ac9177ea53ac59 Mon Sep 17 00:00:00 2001
From: Frajo Haider <f_haider@gmx.at>
Date: Wed, 22 Jan 2020 10:47:20 +0200
Subject: [PATCH 1/9] Revert "linux-user: Use safe_syscall for open and openat
system calls"

This reverts commit c10a07387b77b94d8f7233f3b5bb559211d4e49a.
---
linux-user/syscall.c | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 96cd4bf86d..17b13f0ca3 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -362,6 +362,18 @@ static int sys_getcwd1(char *buf, size_t size)
return strlen(buf)+1;
}

+static int sys_openat(int dirfd, const char *pathname, int flags, mode_t mode)
+{
+ /*
+ * open(2) has extra parameter 'mode' when called with
+ * flag O_CREAT.
+ */
+ if ((flags & O_CREAT) != 0) {
+ return (openat(dirfd, pathname, flags, mode));
+ }
+ return (openat(dirfd, pathname, flags));
+}
+
#ifdef TARGET_NR_utimensat
#if defined(__NR_utimensat)
#define __NR_sys_utimensat __NR_utimensat
@@ -718,8 +730,6 @@ static type safe_##name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, \

safe_syscall3(ssize_t, read, int, fd, void *, buff, size_t, count)
safe_syscall3(ssize_t, write, int, fd, const void *, buff, size_t, count)
-safe_syscall4(int, openat, int, dirfd, const char *, pathname, \
- int, flags, mode_t, mode)
safe_syscall4(pid_t, wait4, pid_t, pid, int *, status, int, options, \
struct rusage *, rusage)
safe_syscall5(int, waitid, idtype_t, idtype, id_t, id, siginfo_t *, infop, \
@@ -6816,7 +6826,7 @@ static int do_openat(void *cpu_env, int dirfd, const char *pathname, int flags,

if (is_proc_myself(pathname, "exe")) {
int execfd = qemu_getauxval(AT_EXECFD);
- return execfd ? execfd : safe_openat(dirfd, exec_path, flags, mode);
+ return execfd ? execfd : sys_openat(dirfd, exec_path, flags, mode);
}

for (fake_open = fakes; fake_open->filename; fake_open++) {
@@ -6852,7 +6862,7 @@ static int do_openat(void *cpu_env, int dirfd, const char *pathname, int flags,
return fd;
}

- return safe_openat(dirfd, path(pathname), flags, mode);
+ return sys_openat(dirfd, path(pathname), flags, mode);
}

#define TIMER_MAGIC 0x0caf0000
--
2.20.1

48 changes: 0 additions & 48 deletions rpm/0001-linux-user-add-getrandom-syscall.patch

This file was deleted.

0 comments on commit 4a1091e

Please sign in to comment.