From nobody Tue Feb 10 09:10:54 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1598622270; cv=none; d=zohomail.com; s=zohoarc; b=Ryw3NpPsvPadRc2dW0sagOm5fDsSqkxI8sJjuCPVa7DXENxD23Ukfg8jqGLgNHJ0m509EKtxKpPCOexUEXv50ifnEhoP+fXeq8aJI3dhcFF2O2QdO66crsolxSZYpLG9M2OWS1lM4Z/TiadOV9IgS5WZGQQPUI3owBYzolEmENM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598622270; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=0/CM98bizD3Or3UAFuU69oPKVBE38360UbLIKHojOm0=; b=PnmxhX65K45EvR6PSA5qHztMtUxp/bTK97zXgoJzu6ZS7o930FF360aXbBNlX3SrnZqh0wlmPFZESHNGeRc2a1aqF7eY2rFL5DnmAvbmwrFAsSsY75PvrKqdnU9MPAPPE/KL1HYZ5JDFg/PqWVo16FZLtFMTDfreUy3PiNryB+c= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 159862227055517.637667629844373; Fri, 28 Aug 2020 06:44:30 -0700 (PDT) Received: from localhost ([::1]:48508 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kBeg8-0000JK-RP for importer@patchew.org; Fri, 28 Aug 2020 09:44:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36984) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kBeaC-00049C-E4 for qemu-devel@nongnu.org; Fri, 28 Aug 2020 09:38:20 -0400 Received: from mout.kundenserver.de ([212.227.126.133]:47231) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kBea8-0007Hm-QR for qemu-devel@nongnu.org; Fri, 28 Aug 2020 09:38:20 -0400 Received: from localhost.localdomain ([82.252.135.186]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MUl4z-1k2gQw4A9h-00Qg2V; Fri, 28 Aug 2020 15:38:08 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 14/18] linux-user: fix target_to_host_timespec64() Date: Fri, 28 Aug 2020 15:37:49 +0200 Message-Id: <20200828133753.2622286-15-laurent@vivier.eu> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200828133753.2622286-1-laurent@vivier.eu> References: <20200828133753.2622286-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:Qfsq6b94jqQKAP9drriZ6LkOSDv9q1rbn5oZsTi5RTrmRfSYYt2 JTDkF1a8XN1vTze8cejKdM3Tse1T8Cg7Ysee1dN4EyIwTUdmi1Cdk4JirXtEsgFMIlXdv6w 24VPSaK55SGrl9sCIGNWHR43Z6sjYj8VtAJ9z4A9TH1U4GdWO8IvJRFkz3WfP+WHRY/yCeK BLm8C/0B0nUTPGea+h/bw== X-UI-Out-Filterresults: notjunk:1;V03:K0:File1mpwMLE=:sjL1ljiU5dOKGpYPMdalH8 dl0wJgLMhmM94K9mMyGDhdQDKnDaIk/OI4l4DrbDyixf5oF7QVoKFqdjeU4s2HWyGRHwnyPt2 mX0akO46a+p6x3Bjn0WGqZmz14THPoFsMbtxi57yDsMsD4G6GsynqNbEDxuPsQ1tZwc4G8hJX FXREF8mEe3/ROcvbQtYlzU57bAM0l6zkgnL42pWJckM+TBRjVdzy6eCsURsPAc6xloVbdQUCx xVmH4S6z4lFHS+IxhEEvX+yDpKaRUbgRkNC7CTFxemypLwulc5Uu20p9Xd6w16Yax3o2BDB4B xm1IXjsR4TGXyX3gIcaV+Ki7JGTlEsH0kMg4nH5Uo9/qCY2MFIqIULCtUc9X+ZSxqEOyGvvjw rSCOL5r7is3caYxJ14txY/yBKG1P/66xfauT0pg+6cKsyANGRcrAy6lRU7gXC9tvnDI4B5FYP BlQQSu5ushRAMuRjRt/wefq9ad7jVVC+yxaXPjZQEQ1eTfW5gxKWRbR3IuVZeZVnPuwoBIpgF Lkooe2dSCSRG3GghZa1loP1JPQIjmWUa0yod532h29R6y7KaATNALquBrpNxh5cieXQRjhlGF 6E3abF68nI/qSA1oLNx0kDTtADjYcOzUJZS/uScRxWyOatVMQpmuab5rU8pJq6KDlvYC13HRN YmHJTmp0fnh4gRK44SGawFQVrIdEoRh4FkaTgn5cyHg0+1Cdd/lSHnwTvaZL3EEE07hyZ7sgD Ab4z585JYZBGP+VoTQ4EZCRR+kVm4nDF0OiPb5384TTFNPdlCFN+4GKciP+NlMIuyXtXb6hjE eS7teEj0SkY/I50DlbJSswgmFcbzlASH7YDYChT8qMvqx1sNFRJ8jGBpqTr2j4FuVCTOrvB Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=212.227.126.133; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/28 09:38:06 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Riku Voipio , Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" in 32 bit mode, drop the padding in tv_nsec. If host is 64bit and target is 32bit, the padding bytes will be copied from the target and as the kernel checks the value, the syscall exits with EINVAL. Signed-off-by: Laurent Vivier Message-Id: <20200827070449.2386007-1-laurent@vivier.eu> Fixes: c6c8d1026e75 ("linux-user/syscall: Add support for clock_gettime64/c= lock_settime64") --- linux-user/syscall.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index fd13e72305de..3b725bbe2513 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -1229,6 +1229,8 @@ static inline abi_long target_to_host_timespec64(stru= ct timespec *host_ts, } __get_user(host_ts->tv_sec, &target_ts->tv_sec); __get_user(host_ts->tv_nsec, &target_ts->tv_nsec); + /* in 32bit mode, this drops the padding */ + host_ts->tv_nsec =3D (long)(abi_long)host_ts->tv_nsec; unlock_user_struct(target_ts, target_addr, 0); return 0; } --=20 2.26.2