All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Anuj Mittal" <anuj.mittal@intel.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH][zeus 02/18] qemu: Replace stime() API with clock_settime
Date: Tue,  5 May 2020 14:56:37 +0800	[thread overview]
Message-ID: <e69b89575e5ccec243658e09936908dd9e5d45ef.1588661196.git.anuj.mittal@intel.com> (raw)
In-Reply-To: <cover.1588661196.git.anuj.mittal@intel.com>

From: Khem Raj <raj.khem@gmail.com>

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
---
 meta/recipes-devtools/qemu/qemu.inc           |  1 +
 ...linux-user-remove-host-stime-syscall.patch | 61 +++++++++++++++++++
 2 files changed, 62 insertions(+)
 create mode 100644 meta/recipes-devtools/qemu/qemu/0011-linux-user-remove-host-stime-syscall.patch

diff --git a/meta/recipes-devtools/qemu/qemu.inc b/meta/recipes-devtools/qemu/qemu.inc
index f451017f6d..ad4ff52892 100644
--- a/meta/recipes-devtools/qemu/qemu.inc
+++ b/meta/recipes-devtools/qemu/qemu.inc
@@ -27,6 +27,7 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \
            file://0008-linux-user-Fix-webkitgtk-hangs-on-32-bit-x86-target.patch \
            file://0009-Fix-webkitgtk-builds.patch \
            file://0010-configure-Add-pkg-config-handling-for-libgcrypt.patch \
+           file://0011-linux-user-remove-host-stime-syscall.patch \
            file://CVE-2019-15890.patch \
            file://CVE-2019-12068.patch \
            file://CVE-2020-1711.patch \
diff --git a/meta/recipes-devtools/qemu/qemu/0011-linux-user-remove-host-stime-syscall.patch b/meta/recipes-devtools/qemu/qemu/0011-linux-user-remove-host-stime-syscall.patch
new file mode 100644
index 0000000000..659e6be45d
--- /dev/null
+++ b/meta/recipes-devtools/qemu/qemu/0011-linux-user-remove-host-stime-syscall.patch
@@ -0,0 +1,61 @@
+From 0f1f2d4596aee037d3ccbcf10592466daa54107f Mon Sep 17 00:00:00 2001
+From: Laurent Vivier <laurent@vivier.eu>
+Date: Tue, 12 Nov 2019 15:25:56 +0100
+Subject: [PATCH] linux-user: remove host stime() syscall
+
+stime() has been withdrawn from glibc
+(12cbde1dae6f "Use clock_settime to implement stime; withdraw stime.")
+
+Implement the target stime() syscall using host
+clock_settime(CLOCK_REALTIME, ...) as it is done internally in glibc.
+
+Tested qemu-ppc/x86_64 with:
+
+	#include <time.h>
+	#include <stdio.h>
+
+	int main(void)
+	{
+		time_t t;
+		int ret;
+
+		/* date -u -d"2019-11-12T15:11:00" "+%s" */
+		t = 1573571460;
+		ret = stime(&t);
+		printf("ret %d\n", ret);
+		return 0;
+	}
+
+        # date; ./stime; date
+        Tue Nov 12 14:18:32 UTC 2019
+        ret 0
+        Tue Nov 12 15:11:00 UTC 2019
+
+Upstream-Status: Backport [https://git.qemu.org/?p=qemu.git;a=commit;h=0f1f2d4596aee037d3ccbcf10592466daa54107f]
+Buglink: https://bugs.launchpad.net/qemu/+bug/1852115
+Reported-by: Cole Robinson <crobinso@redhat.com>
+Signed-off-by: Laurent Vivier <laurent@vivier.eu>
+Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
+Message-Id: <20191112142556.6335-1-laurent@vivier.eu>
+---
+ linux-user/syscall.c | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+--- a/linux-user/syscall.c
++++ b/linux-user/syscall.c
+@@ -7651,10 +7651,12 @@ static abi_long do_syscall1(void *cpu_en
+ #ifdef TARGET_NR_stime /* not on alpha */
+     case TARGET_NR_stime:
+         {
+-            time_t host_time;
+-            if (get_user_sal(host_time, arg1))
++            struct timespec ts;
++            ts.tv_nsec = 0;
++            if (get_user_sal(ts.tv_sec, arg1)) {
+                 return -TARGET_EFAULT;
+-            return get_errno(stime(&host_time));
++            }
++            return get_errno(clock_settime(CLOCK_REALTIME, &ts));
+         }
+ #endif
+ #ifdef TARGET_NR_alarm /* not on alpha */
-- 
2.25.4


  parent reply	other threads:[~2020-05-05  6:57 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-05  6:56 [PATCH][zeus 00/18] zeus patch review Anuj Mittal
2020-05-05  6:56 ` [PATCH][zeus 01/18] python3-native: Should not search the system for headers/libraries Anuj Mittal
2020-05-05  6:56 ` Anuj Mittal [this message]
2020-05-05  6:56 ` [PATCH][zeus 03/18] prservice.py: fix do_package with newer Python in Ubuntu 20.04 Anuj Mittal
2020-05-05  6:56 ` [PATCH][zeus 04/18] apt-native: don't let dpkg overwrite files by default Anuj Mittal
2020-05-05  6:56 ` [PATCH][zeus 05/18] glibc: CVE-2020-1751 Anuj Mittal
2020-05-05  6:56 ` [PATCH][zeus 06/18] git: Security Advisory - git - CVE-2020-5260 Anuj Mittal
2020-05-05  6:56 ` [PATCH][zeus 07/18] git: Security Advisory - git - CVE-2020-11008 Anuj Mittal
2020-05-05  6:56 ` [PATCH][zeus 08/18] cve-update-db-native: clean DB if temporary file exist Anuj Mittal
2020-05-05  6:56 ` [PATCH][zeus 09/18] qemu: Add PACKAGECONFIG for glusterfs Anuj Mittal
2020-05-05  6:56 ` [PATCH][zeus 10/18] gnupg: upgrade 2.2.17 -> 2.2.19 Anuj Mittal
2020-05-05  6:56 ` [PATCH][zeus 11/18] python: Upgrade 2.7.17 -> 2.17.18 Anuj Mittal
2020-05-05  6:56 ` [PATCH][zeus 12/18] qemu: fix CVE-2020-7039 Anuj Mittal
2020-05-05  6:56 ` [PATCH][zeus 13/18] qemu/slirp: fix CVE-2020-7211 Anuj Mittal
2020-05-05  6:56 ` [PATCH][zeus 14/18] gnutls: upgrade 3.6.8 -> 3.6.11.1 Anuj Mittal
2020-05-05  6:56 ` [PATCH][zeus 15/18] gnutls: upgrade 3.6.11.1 -> 3.6.12 Anuj Mittal
2020-05-05  6:56 ` [PATCH][zeus 16/18] gnutls: upgrade 3.6.12 -> 3.6.13 Anuj Mittal
2020-05-05  6:56 ` [PATCH][zeus 17/18] systemd: Fix CVE-2020-1712 Anuj Mittal
2020-05-05  6:56 ` [PATCH][zeus 18/18] openssl: upgrade 1.1.1f -> 1.1.1g Anuj Mittal
2020-05-05  7:02 ` ✗ patchtest: failure for zeus patch review Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e69b89575e5ccec243658e09936908dd9e5d45ef.1588661196.git.anuj.mittal@intel.com \
    --to=anuj.mittal@intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.