Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4424720ybi; Tue, 30 Jul 2019 01:48:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqy5VbtiRXObX6rkqVjQq/Zd66yN7+y2CJKPJ0/oyGYzpg53rozY7q9SoN0AkJfwSA3Bpp4t X-Received: by 2002:a62:be02:: with SMTP id l2mr41747485pff.63.1564476526216; Tue, 30 Jul 2019 01:48:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564476526; cv=none; d=google.com; s=arc-20160816; b=G6OXedlbmM30pn7vBt9M35SxaklrY/6c90fQs665i1zvWtCgZ1Swb/TigaPAiL98xs UQ0PO2IQN/CHNPzcs7mN4St/N8nMieRO7bs9nvbErvVjmMwrKlbThgs54qK6yj9bZeDd NLURHYw6fakQRsyDWNnNeazSp7PCj2aaEid6K/9RaYWpaTfpKG2ik21NBgl1wkD4sHlI +xCeLov2AzAtJIjux5pBpzSeSkpipfeeIHGgfe2EDQJMKRa5FSkwERp1zlyOvlb040tN dU301pLrKzpeplKOptZ18SS5Q5HcVNm0rSxgUPkkVk6vPdLvtgr3dMeD/safiqSw7uTI hyFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=s8TNpPfRzkd/STVPqA/OmSveOcsf2nPj4laDcq0UFS8=; b=tXZ+Zfi+5gkQd55dPi2NEzggVX4oAIB0Td43avY/F7UaKyflxfA4jtCK2ppYJyrHL+ Bhanho/YJ3jRy3eB7qv7sWb9OuYleYDFNCZ5uGtnJjOA8tXn1Rq4ny2HzWdhOrqL4M+L AB8501Mx4CGTPDm84Ay71dh+sepTmXscwV5/ItsMw3VDRDe4TxDmzF5stpB01q/iIXZz 4O21hwVOVX4bV8cGj5p5hZQFllaMaG9SWK3YoDOsQATE+Nc7a7Lg7eSPvceUvYtl8ixw aMIrE1P8NGteyYVJrQCYUXRQumG5OpkXuDEzoCGOluUrYIGaWgK648TrnWaWDZH9kdNg 3S7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arista.com header.s=googlenew header.b="J/yMUgi7"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=REJECT dis=NONE) header.from=arista.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v15si28315968pfm.238.2019.07.30.01.48.31; Tue, 30 Jul 2019 01:48:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@arista.com header.s=googlenew header.b="J/yMUgi7"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=REJECT dis=NONE) header.from=arista.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729307AbfG2WBs (ORCPT + 99 others); Mon, 29 Jul 2019 18:01:48 -0400 Received: from mail-wm1-f52.google.com ([209.85.128.52]:40243 "EHLO mail-wm1-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389255AbfG2V6S (ORCPT ); Mon, 29 Jul 2019 17:58:18 -0400 Received: by mail-wm1-f52.google.com with SMTP id v19so54829144wmj.5 for ; Mon, 29 Jul 2019 14:58:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arista.com; s=googlenew; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=s8TNpPfRzkd/STVPqA/OmSveOcsf2nPj4laDcq0UFS8=; b=J/yMUgi7iMEAQ2WpRqDSNy6MFsL7kyNsDQu8Yi4RlvU6lloGIOeUeFvcMpb5kPY2N0 Gxkcp/BjRuLchidbhOtgSwup/V35CZHd7VHsru3aHwngyl+hRdK6FjhtBK9At4mvD7ar KMYMBtfNKHePWUWFEdzL0JAYRq0hLB3z5luoUHvQXJV6CISw24ahW4oW3qlGkV12wYBl IT7urvkxHJjWRScu6Mcg3fMKVJmsOYKLqV1IKGMzxlNi2FWaw2KY8thOvrRg/8lTiXUg Ef67SrP0z3GKttqi6QNH6tAB5ek+uo9Rnlex07Nl3oGJl7gvOrtC3wwMFZwPUKdwtJ2j qXbQ== 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=s8TNpPfRzkd/STVPqA/OmSveOcsf2nPj4laDcq0UFS8=; b=XsZ1gi0JhWk88uugZpynCJlOgY/JyG41iqeOELnICiYXTLhdNR+toEoW510ReluP0u Ul6wtKPZVK3f4p3cqLdFsu0HciqBqZEWdwaJbPeJKwAXH9ZkkDCOv5ZGae9q9o/9VopF b+rxbHP5xCWnnQLvrdv5tFS+UYyUuLrPHPLwSBOUEKaVEq5AvFqlE3LK8NEN6Z8LYaqr 7zYLkj9l001pgXzDdFq+nB/BPnGuEYH1lVE2aBBcpVJ5SlXFAZPzr/tztqV+lRXBzYQy /rF61UpDEx9zjvAC75nOyHiX6iQWfV7Ir5j2P6VgIyqK/xTBS4m9Y3gAQnpckNbSN9QZ CWuw== X-Gm-Message-State: APjAAAU50M7UhWGdAttOo1S2/3xzGj95v+ERVi7HF7FXp7pbOZaOI1vl 6yNvG5NvWBPQGapfMZvV5hugBfp5MetGzzd1TGykPXX5modcNnowlPpnVS3sWzP9kVt/ZPwUxD4 lzHRKSCA4wDEcZ6775NL1SHLk7UuTIv0SiaDjLO3KqYlqx/vO+I2HNgX4SbieMmKwLX+hZOqrPM Au/SzJ1LT1PSW4QR6npPpTjOkoI5uDN565KsTb7pE= X-Received: by 2002:a7b:c8d4:: with SMTP id f20mr104786959wml.90.1564437496783; Mon, 29 Jul 2019 14:58:16 -0700 (PDT) Received: from Mindolluin.ire.aristanetworks.com ([217.173.96.166]) by smtp.gmail.com with ESMTPSA id x20sm49230728wmc.1.2019.07.29.14.58.15 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 29 Jul 2019 14:58:16 -0700 (PDT) From: Dmitry Safonov To: linux-kernel@vger.kernel.org Cc: Dmitry Safonov <0x7f454c46@gmail.com>, Andrei Vagin , Dmitry Safonov , Adrian Reber , Andrei Vagin , Andy Lutomirski , Arnd Bergmann , Christian Brauner , Cyrill Gorcunov , "Eric W. Biederman" , "H. Peter Anvin" , Ingo Molnar , Jann Horn , Jeff Dike , Oleg Nesterov , Pavel Emelyanov , Shuah Khan , Thomas Gleixner , Vincenzo Frascino , containers@lists.linux-foundation.org, criu@openvz.org, linux-api@vger.kernel.org, x86@kernel.org Subject: [PATCHv5 12/37] timerfd: Make timerfd_settime() time namespace aware Date: Mon, 29 Jul 2019 22:56:54 +0100 Message-Id: <20190729215758.28405-13-dima@arista.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190729215758.28405-1-dima@arista.com> References: <20190729215758.28405-1-dima@arista.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CLOUD-SEC-AV-Info: arista,google_mail,monitor X-CLOUD-SEC-AV-Sent: true X-Gm-Spam: 0 X-Gm-Phishy: 0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andrei Vagin timerfd_settime() accepts an absolute value of the experation time if TFD_TIMER_ABSTIME is specified. This value is in task's time namespace and has to be converted to the host's time namespace. Signed-off-by: Andrei Vagin Co-developed-by: Dmitry Safonov Signed-off-by: Dmitry Safonov --- fs/timerfd.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/timerfd.c b/fs/timerfd.c index 6a6fc8aa1de7..9b0c2f65e7e8 100644 --- a/fs/timerfd.c +++ b/fs/timerfd.c @@ -26,6 +26,7 @@ #include #include #include +#include struct timerfd_ctx { union { @@ -196,6 +197,8 @@ static int timerfd_setup(struct timerfd_ctx *ctx, int flags, } if (texp != 0) { + if (flags & TFD_TIMER_ABSTIME) + texp = timens_ktime_to_host(clockid, texp); if (isalarm(ctx)) { if (flags & TFD_TIMER_ABSTIME) alarm_start(&ctx->t.alarm, texp); -- 2.22.0