From patchwork Sun Dec 22 04:05:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 182364 Delivered-To: patch@linaro.org Received: by 2002:a92:1f98:0:0:0:0:0 with SMTP id f24csp2504138ilf; Sat, 21 Dec 2019 20:07:15 -0800 (PST) X-Google-Smtp-Source: APXvYqy6zFE5HFTXkRLK8uvCrk5Nw4Xe0/12ZBmZJnJ90H5/ZPEhj2pNAlarpi1A89Zxj0EyY6pF X-Received: by 2002:a17:902:758f:: with SMTP id j15mr23836410pll.201.1576987635354; Sat, 21 Dec 2019 20:07:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576987635; cv=none; d=google.com; s=arc-20160816; b=XsIPuveQ95Ra2iOhcDSrndeMl5icRqcWsBuUt6T1LyQL4OZhGJAbis90xW6IbpBzm+ UWqJPPA5s6kEucIDIeoUOXqcyvYlZ2iWYwRXYuoWx6zpP5IcDSbFOj1h2jaKqYxeqlf7 gAnWL4n92U0a46l/8neuI91vn/gcvYP98IQwFBibs+bD/i8ZLQsYbcGgDZByR+BWgfzy wiDftr0r0K8MzTEOHOi3aIxOs0+gxqfXEtSvVRlmNjs0SYUx1bkStCgEslOMJcvbwEAy ZrwkvL3x7y+xhurireHTNdMQHr7VFoWffJ6mDV0RChjz5w0/dvOazim7ByzJmw8HeiW9 pcOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:delivered-to; bh=qala9vR3u+iSlv4RjFYE5o1Zpg+DGrr0z0W/35M38LE=; b=JxTaiWgy8W5BWCgq0IpBIdIACWBRRksRl0oDn/bmubof+tf5FcmoWuEho/WhMzmWEg SU48N8+sUiuukHKoO54oOtRluH1bCcecrI36G4lYUc5CoqdFbMKwUQwWVsjjEWUu5CTI zoMK3drBtOX70l5ApT+weJBAirFlVAg4exFvcfG8vZ3yisui/qIx4CVKvi27YN7YVqhy 3J/3P5aByU63SsVn+RlP+L41iXudbzEGoM56SwdXWk5HQqae7JdAnzaIySSa3SfdlEiU UBK88pY1ugEVYxwrg9nMUqdgNUWEnTbPzZb7jaEOVb2WGYXLIz5kui8S5gQlqw9fjCwh kQ1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=hErXke01; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id u18si5794101pjx.25.2019.12.21.20.07.15; Sat, 21 Dec 2019 20:07:15 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) client-ip=140.211.169.62; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=hErXke01; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from ec2-34-214-78-129.us-west-2.compute.amazonaws.com (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id 1614B7FCB0; Sun, 22 Dec 2019 04:07:13 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-pj1-f67.google.com (mail-pj1-f67.google.com [209.85.216.67]) by mail.openembedded.org (Postfix) with ESMTP id D1F277F63C for ; Sun, 22 Dec 2019 04:05:58 +0000 (UTC) Received: by mail-pj1-f67.google.com with SMTP id s7so5938183pjc.0 for ; Sat, 21 Dec 2019 20:06:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=XFqCijbHOrjH0s+m7FR3fVNyb9xzQ/If7eo66o7JPCA=; b=hErXke01Mw85vLgtn+J8Z6H8KzFNrfEK2tLScN+Xp/5llypi7gcLOANUQDdWmZk0d1 GdCu93fOcNEOETGuc4Zgnb04bxuMlsYXJQ70KE/2jGTAobBcqHEccIk9OozatYF3bG0p tnaVv3uXR2BWcRDul7cuVWm2+Y94+VwIvQMPeTjrIfLClltwzr4e9OiK40y+hkyXy+LS DfnT+cikv32Wi8OAlqd1ZWLxEJlLyGT1ms3G+64V1a4wtjMIdnXuZV1UPV63dn7rr7vW 5zrAkklktqJ/iDtxtpwhUygRkaXKtKUhnzg5YsrqPte8BBonKxV4dmqpsfyJJux8nEOH xUkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=XFqCijbHOrjH0s+m7FR3fVNyb9xzQ/If7eo66o7JPCA=; b=A20zmgDit+RObI5ORUhoOXwRaSqZLMlFjxWtQeVUrciyHedfK5VRCJsw7gE+NAXoOZ XC9vaJnOMpckdkgpk1AOdd3gQ3n+/HQJHHYox17rrY9sVfMiOxWAxDsWMAq+dDwWMt53 FVZrS44tS2CSOcPQNNw6/Hy5p2ikPUuLtIOuw/DsUiAJXwipAl1FXc0Y9dGhpmlLArPH CLAoO4pAQIx3fYlxFWNbKRGgi4nsUV0hqTYRCEDXqO48i+pw10YW/5jx7qv0t2OJosCq 9njLjO+fPCxnsL84I0YswnKE3j/y9HQpJZihx3nEsPTHTldVGy4ByBriXne2e7TbxGXI d3Tg== X-Gm-Message-State: APjAAAUk7IJihlgmFcwmQISBPJbcjqZ7cnJL61NwwwTadwgGceNRzkzq bWoiN8xWGfcohC+1ko6O85ftaO0MsIo= X-Received: by 2002:a17:902:59cd:: with SMTP id d13mr24322716plj.146.1576987559247; Sat, 21 Dec 2019 20:05:59 -0800 (PST) Received: from apollo.hsd1.ca.comcast.net ([2601:646:9200:4e0::36e9]) by smtp.gmail.com with ESMTPSA id h16sm18988306pfn.85.2019.12.21.20.05.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Dec 2019 20:05:58 -0800 (PST) From: Khem Raj To: openembedded-core@lists.openembedded.org Date: Sat, 21 Dec 2019 20:05:48 -0800 Message-Id: <20191222040549.286151-3-raj.khem@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191222040549.286151-1-raj.khem@gmail.com> References: <20191222040549.286151-1-raj.khem@gmail.com> MIME-Version: 1.0 Subject: [OE-core] [PATCH 3/4] qemu: Replace stime() API with clock_settime X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: openembedded-core-bounces@lists.openembedded.org Errors-To: openembedded-core-bounces@lists.openembedded.org Signed-off-by: Khem Raj --- 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 -- 2.24.1 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core diff --git a/meta/recipes-devtools/qemu/qemu.inc b/meta/recipes-devtools/qemu/qemu.inc index 601fc2286b..07dabfe25c 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 \ " 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 +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 + #include + + 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 +Signed-off-by: Laurent Vivier +Reviewed-by: Peter Maydell +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 */