Skip to content

Commit

Permalink
qemu-usermode: rebase patches.
Browse files Browse the repository at this point in the history
[qemu-usermode] rebase patches. JB#51953
  • Loading branch information
krnlyng committed Dec 8, 2020
1 parent e21ea32 commit 5771c2f
Show file tree
Hide file tree
Showing 16 changed files with 108 additions and 106 deletions.
20 changes: 10 additions & 10 deletions rpm/0001-Revert-linux-user-Use-safe_syscall-for-open-and-open.patch
@@ -1,7 +1,7 @@
From c5ee3e5707dcf49d62b4b7d4714d9861153a900d Mon Sep 17 00:00:00 2001
From 0ac39b60e1b500f54cd46c4cc38e7e70b215c8d8 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 01/18] Revert "linux-user: Use safe_syscall for open and
Subject: [PATCH 01/15] Revert "linux-user: Use safe_syscall for open and
openat system calls"

This reverts commit c10a07387b77b94d8f7233f3b5bb559211d4e49a.
Expand All @@ -10,12 +10,12 @@ This reverts commit c10a07387b77b94d8f7233f3b5bb559211d4e49a.
1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 171c0ca..55a96ad 100644
index 945fc25279..b8e9b839a2 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -375,6 +375,18 @@ static int sys_getcwd1(char *buf, size_t size)
return strlen(buf)+1;
}
@@ -390,6 +390,18 @@ static bitmask_transtbl fcntl_flags_tbl[] = {

_syscall2(int, sys_getcwd1, char *, buf, size_t, size)

+static int sys_openat(int dirfd, const char *pathname, int flags, mode_t mode)
+{
Expand All @@ -32,7 +32,7 @@ index 171c0ca..55a96ad 100644
#ifdef TARGET_NR_utimensat
#if defined(__NR_utimensat)
#define __NR_sys_utimensat __NR_utimensat
@@ -731,8 +743,6 @@ static type safe_##name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, \
@@ -746,8 +758,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)
Expand All @@ -41,7 +41,7 @@ index 171c0ca..55a96ad 100644
#if defined(TARGET_NR_wait4) || defined(TARGET_NR_waitpid)
safe_syscall4(pid_t, wait4, pid_t, pid, int *, status, int, options, \
struct rusage *, rusage)
@@ -7198,7 +7208,7 @@ static int do_openat(void *cpu_env, int dirfd, const char *pathname, int flags,
@@ -7614,7 +7624,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);
Expand All @@ -50,7 +50,7 @@ index 171c0ca..55a96ad 100644
}

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

Expand All @@ -60,5 +60,5 @@ index 171c0ca..55a96ad 100644

#define TIMER_MAGIC 0x0caf0000
--
1.8.3-rc3
2.26.2

@@ -1,7 +1,7 @@
From 8a45f877babcdddc8061026924923bb42ad97bd0 Mon Sep 17 00:00:00 2001
From 89a2ff52ab649304b05ec90f27ca0e00390272ec Mon Sep 17 00:00:00 2001
From: Frajo Haider <f_haider@gmx.at>
Date: Wed, 22 Jan 2020 10:48:18 +0200
Subject: [PATCH 02/18] Revert "linux-user: Use safe_syscall for execve
Subject: [PATCH 02/15] Revert "linux-user: Use safe_syscall for execve
syscall"

This reverts commit ffdcbe223d23461669869e85786145cce65e1e8c.
Expand All @@ -10,18 +10,18 @@ This reverts commit ffdcbe223d23461669869e85786145cce65e1e8c.
1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 55a96ad..11e3e41 100644
index b8e9b839a2..c0f675800d 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -747,7 +747,6 @@ safe_syscall4(pid_t, wait4, pid_t, pid, int *, status, int, options, \
struct rusage *, rusage)
@@ -764,7 +764,6 @@ safe_syscall4(pid_t, wait4, pid_t, pid, int *, status, int, options, \
#endif
safe_syscall5(int, waitid, idtype_t, idtype, id_t, id, siginfo_t *, infop, \
int, options, struct rusage *, rusage)
-safe_syscall3(int, execve, const char *, filename, char **, argv, char **, envp)
#if defined(TARGET_NR_select) || defined(TARGET_NR__newselect) || \
defined(TARGET_NR_pselect6)
safe_syscall6(int, pselect6, int, nfds, fd_set *, readfds, fd_set *, writefds, \
@@ -7614,17 +7613,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
@@ -8033,17 +8032,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,

if (!(p = lock_user_string(arg1)))
goto execve_efault;
Expand All @@ -41,5 +41,5 @@ index 55a96ad..11e3e41 100644

goto execve_end;
--
1.8.3-rc3
2.26.2

@@ -1,7 +1,7 @@
From 8ddd86705568ebc51a4dbac9a5070ea5707dc066 Mon Sep 17 00:00:00 2001
From c45d32c85a6d98e6fb20025af3ee96abfdccf925 Mon Sep 17 00:00:00 2001
From: Frajo Haider <f_haider@gmx.at>
Date: Wed, 22 Jan 2020 10:57:53 +0200
Subject: [PATCH 03/18] Revert "linux-user: Use safe_syscall wrapper for send*
Subject: [PATCH 03/15] Revert "linux-user: Use safe_syscall wrapper for send*
and recv* syscalls"

This reverts commit 666875306e03e1f94e1d4c808502585c10abc69a.
Expand All @@ -10,10 +10,10 @@ This reverts commit 666875306e03e1f94e1d4c808502585c10abc69a.
1 file changed, 7 insertions(+), 15 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 11e3e41..5d6c87a 100644
index c0f675800d..4b87fafe44 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -767,14 +767,6 @@ safe_syscall5(ssize_t, preadv, int, fd, const struct iovec *, iov, int, iovcnt,
@@ -795,14 +795,6 @@ safe_syscall5(ssize_t, preadv, int, fd, const struct iovec *, iov, int, iovcnt,
unsigned long, pos_l, unsigned long, pos_h)
safe_syscall5(ssize_t, pwritev, int, fd, const struct iovec *, iov, int, iovcnt,
unsigned long, pos_l, unsigned long, pos_h)
Expand All @@ -26,9 +26,9 @@ index 11e3e41..5d6c87a 100644
-safe_syscall3(ssize_t, sendmsg, int, fd, const struct msghdr *, msg, int, flags)
-safe_syscall3(ssize_t, recvmsg, int, fd, struct msghdr *, msg, int, flags)
safe_syscall2(int, flock, int, fd, int, operation)
#ifdef TARGET_NR_rt_sigtimedwait
safe_syscall4(int, rt_sigtimedwait, const sigset_t *, these, siginfo_t *, uinfo,
const struct timespec *, uts, size_t, sigsetsize)
@@ -2990,17 +2982,17 @@ static abi_long do_sendrecvmsg_locked(int fd, struct target_msghdr *msgp,
@@ -3141,17 +3133,17 @@ static abi_long do_sendrecvmsg_locked(int fd, struct target_msghdr *msgp,
msg.msg_iov->iov_len);
if (ret >= 0) {
msg.msg_iov->iov_base = host_msg;
Expand All @@ -49,7 +49,7 @@ index 11e3e41..5d6c87a 100644
if (!is_error(ret)) {
len = ret;
if (fd_trans_host_to_target_data(fd)) {
@@ -3245,9 +3237,9 @@ static abi_long do_sendto(int fd, abi_ulong msg, size_t len, int flags,
@@ -3396,9 +3388,9 @@ static abi_long do_sendto(int fd, abi_ulong msg, size_t len, int flags,
if (ret) {
goto fail;
}
Expand All @@ -61,7 +61,7 @@ index 11e3e41..5d6c87a 100644
}
fail:
if (copy_msg) {
@@ -3282,12 +3274,12 @@ static abi_long do_recvfrom(int fd, abi_ulong msg, size_t len, int flags,
@@ -3433,12 +3425,12 @@ static abi_long do_recvfrom(int fd, abi_ulong msg, size_t len, int flags,
}
addr = alloca(addrlen);
ret_addrlen = addrlen;
Expand All @@ -77,5 +77,5 @@ index 11e3e41..5d6c87a 100644
if (!is_error(ret)) {
if (fd_trans_host_to_target_data(fd)) {
--
1.8.3-rc3
2.26.2

@@ -1,7 +1,7 @@
From c097e9d61af51fedf44d5a8b4eea41a50a72bd8c Mon Sep 17 00:00:00 2001
From d6f39d396f585b53ef3b1e9214b6d0f55eee5dfa Mon Sep 17 00:00:00 2001
From: Frajo Haider <f_haider@gmx.at>
Date: Wed, 22 Jan 2020 10:59:47 +0200
Subject: [PATCH 04/18] Revert "linux-user: Use safe_syscall wrapper for accept
Subject: [PATCH 04/15] Revert "linux-user: Use safe_syscall wrapper for accept
and accept4 syscalls"

This reverts commit ff6dc130794bcd5b2033bc50262a7720285a74c7.
Expand All @@ -10,10 +10,10 @@ This reverts commit ff6dc130794bcd5b2033bc50262a7720285a74c7.
1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 5d6c87a..96ed793 100644
index 4b87fafe44..50a91b9af7 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -770,8 +770,6 @@ safe_syscall5(ssize_t, pwritev, int, fd, const struct iovec *, iov, int, iovcnt,
@@ -800,8 +800,6 @@ safe_syscall2(int, flock, int, fd, int, operation)
safe_syscall4(int, rt_sigtimedwait, const sigset_t *, these, siginfo_t *, uinfo,
const struct timespec *, uts, size_t, sigsetsize)
#endif
Expand All @@ -22,7 +22,7 @@ index 5d6c87a..96ed793 100644
#if defined(TARGET_NR_nanosleep)
safe_syscall2(int, nanosleep, const struct timespec *, req,
struct timespec *, rem)
@@ -3087,6 +3085,19 @@ static abi_long do_sendrecvmmsg(int fd, abi_ulong target_msgvec,
@@ -3238,6 +3236,19 @@ static abi_long do_sendrecvmmsg(int fd, abi_ulong target_msgvec,
return ret;
}

Expand All @@ -42,7 +42,7 @@ index 5d6c87a..96ed793 100644
/* do_accept4() Must return target values and target errnos. */
static abi_long do_accept4(int fd, abi_ulong target_addr,
abi_ulong target_addrlen_addr, int flags)
@@ -3099,7 +3110,7 @@ static abi_long do_accept4(int fd, abi_ulong target_addr,
@@ -3250,7 +3261,7 @@ static abi_long do_accept4(int fd, abi_ulong target_addr,
host_flags = target_to_host_bitmask(flags, fcntl_flags_tbl);

if (target_addr == 0) {
Expand All @@ -51,7 +51,7 @@ index 5d6c87a..96ed793 100644
}

/* linux returns EINVAL if addrlen pointer is invalid */
@@ -3116,7 +3127,7 @@ static abi_long do_accept4(int fd, abi_ulong target_addr,
@@ -3267,7 +3278,7 @@ static abi_long do_accept4(int fd, abi_ulong target_addr,
addr = alloca(addrlen);

ret_addrlen = addrlen;
Expand All @@ -61,5 +61,5 @@ index 5d6c87a..96ed793 100644
host_to_target_sockaddr(target_addr, addr, MIN(addrlen, ret_addrlen));
if (put_user_u32(ret_addrlen, target_addrlen_addr)) {
--
1.8.3-rc3
2.26.2

@@ -1,7 +1,7 @@
From fc481085c58c1add1bc1b6980c4e0713964e06a9 Mon Sep 17 00:00:00 2001
From d727cbc2df0c396ebe39ecdfb900c564395752c6 Mon Sep 17 00:00:00 2001
From: Frajo Haider <f_haider@gmx.at>
Date: Wed, 22 Jan 2020 11:13:13 +0200
Subject: [PATCH 06/18] Revert "linux-user: Use safe_syscall wrapper for
Subject: [PATCH 05/15] Revert "linux-user: Use safe_syscall wrapper for
connect syscall"

This reverts commit 2a3c7619288af9cfcc09a233dce911bf80849dfb.
Expand All @@ -10,10 +10,10 @@ This reverts commit 2a3c7619288af9cfcc09a233dce911bf80849dfb.
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 9a95158..d5bc5b8 100644
index 50a91b9af7..88a64dc495 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -2907,7 +2907,7 @@ static abi_long do_connect(int sockfd, abi_ulong target_addr,
@@ -3062,7 +3062,7 @@ static abi_long do_connect(int sockfd, abi_ulong target_addr,
if (ret)
return ret;

Expand All @@ -23,5 +23,5 @@ index 9a95158..d5bc5b8 100644

/* do_sendrecvmsg_locked() Must return target values and target errnos. */
--
1.8.3-rc3
2.26.2

@@ -1,18 +1,18 @@
From 3ecf0acf5bc0e7be754bcd69f0535c3dadb2b8ae Mon Sep 17 00:00:00 2001
From 99dc4c635148193e3edfcfa8fecc62748fdf9148 Mon Sep 17 00:00:00 2001
From: Frajo Haider <f_haider@gmx.at>
Date: Wed, 29 Jan 2020 12:49:43 +0200
Subject: [PATCH 07/18] Revert "linux-user: Use direct syscall for utimensat"
Subject: [PATCH 06/15] Revert "linux-user: Use direct syscall for utimensat"

This reverts commit 700fa58e4b9100d6bd77df06d2e5d1f457720c4d.
---
linux-user/syscall.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index d5bc5b8..12ea401 100644
index 88a64dc495..91594472ed 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -388,7 +388,16 @@ static int sys_openat(int dirfd, const char *pathname, int flags, mode_t mode)
@@ -403,7 +403,16 @@ static int sys_openat(int dirfd, const char *pathname, int flags, mode_t mode)
}

#ifdef TARGET_NR_utimensat
Expand All @@ -31,5 +31,5 @@ index d5bc5b8..12ea401 100644
_syscall4(int,sys_utimensat,int,dirfd,const char *,pathname,
const struct timespec *,tsp,int,flags)
--
1.8.3-rc3
2.26.2

@@ -1,18 +1,18 @@
From ec490a9455770826db836662414ad881be18919b Mon Sep 17 00:00:00 2001
From a66c62b4db0643b10d2471b4b5ab046c7afd3cff Mon Sep 17 00:00:00 2001
From: Frajo Haider <f_haider@gmx.at>
Date: Thu, 23 Jan 2020 00:13:32 +0000
Subject: [PATCH 09/18] linux-user: Also ignore attempts to block SIGTERM,
Subject: [PATCH 07/15] linux-user: Also ignore attempts to block SIGTERM,
SIGINT and SIGHUP

---
linux-user/signal.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/linux-user/signal.c b/linux-user/signal.c
index 5ca6d62..36c7b25 100644
index 8cf51ffecd..728929bcab 100644
--- a/linux-user/signal.c
+++ b/linux-user/signal.c
@@ -225,6 +225,9 @@ int do_sigprocmask(int how, const sigset_t *set, sigset_t *oldset)
@@ -241,6 +241,9 @@ int do_sigprocmask(int how, const sigset_t *set, sigset_t *oldset)
/* Silently ignore attempts to change blocking status of KILL or STOP */
sigdelset(&ts->signal_mask, SIGKILL);
sigdelset(&ts->signal_mask, SIGSTOP);
Expand All @@ -23,5 +23,5 @@ index 5ca6d62..36c7b25 100644
return 0;
}
--
1.8.3-rc3
2.26.2

@@ -1,14 +1,14 @@
From d2676f456e54504b18c31c936d6be4c298a694c2 Mon Sep 17 00:00:00 2001
From 71722b7b0709ae5b2d9ce89b42d55b4907173d3c Mon Sep 17 00:00:00 2001
From: Frajo Haider <f_haider@gmx.at>
Date: Mon, 27 Jan 2020 20:34:21 +0200
Subject: [PATCH 13/18] crypto: check if getrandom is available properly
Subject: [PATCH 08/15] crypto: check if getrandom is available properly

---
crypto/random-platform.c | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/crypto/random-platform.c b/crypto/random-platform.c
index f92f969..b45f25d 100644
index f92f96987d..b45f25db24 100644
--- a/crypto/random-platform.c
+++ b/crypto/random-platform.c
@@ -31,7 +31,8 @@ static HCRYPTPROV hCryptProv;
Expand Down Expand Up @@ -60,5 +60,5 @@ index f92f969..b45f25d 100644
error_setg_errno(errp, errno, "getrandom");
return -1;
--
1.8.3-rc3
2.26.2

@@ -1,18 +1,18 @@
From 06305b5dd6c36a3ffd6189245aa7cf1da2a253e3 Mon Sep 17 00:00:00 2001
From 3b522254716b6a1647716ebf4cb47d81da4734d4 Mon Sep 17 00:00:00 2001
From: Frajo Haider <f_haider@gmx.at>
Date: Wed, 29 Jan 2020 11:12:24 +0000
Subject: [PATCH 15/18] make sure mode is passed to openat if O_TMPFILE is
Subject: [PATCH 09/15] make sure mode is passed to openat if O_TMPFILE is
specified. JB#45765

---
linux-user/syscall.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 12ea401..26c80f6 100644
index 91594472ed..5ec9a19ca2 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -381,7 +381,7 @@ static int sys_openat(int dirfd, const char *pathname, int flags, mode_t mode)
@@ -396,7 +396,7 @@ 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.
*/
Expand All @@ -22,5 +22,5 @@ index 12ea401..26c80f6 100644
}
return (openat(dirfd, pathname, flags));
--
1.8.3-rc3
2.26.2

0 comments on commit 5771c2f

Please sign in to comment.