Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1593599yba; Sat, 27 Apr 2019 02:55:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqxRxwwM0WHdkl9GkrzAYMOeXgSjbqYDkovJvm7lmelB4UVqj2QzyxWJfmYJbYHFreKiYY9O X-Received: by 2002:aa7:9351:: with SMTP id 17mr7380985pfn.156.1556358942981; Sat, 27 Apr 2019 02:55:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556358942; cv=none; d=google.com; s=arc-20160816; b=YacD7fk5ZGkRqOMdZOiZTpf7K5CtXfBmo5byBUIE4tWJmhcUit4RbLeAZiTTuwRv/V RV97Mn+w2F/KPpllEx5f4zrn9uvZU4WZw9Cv+0QzVlKwlkzPad5FeesbOvO0MQiw0A67 YffAHKwaJWI+QLzxotAJvJC1+nGm/rEnJGHGyHNnj71k1uckp/Pn/hNR1y2zki9+3H7X NFJQE0LC3VIaC15HRhiHNb/eE6T5CoqXY2ybnGVGykHv3Dt41QyCxJVJXEFAyBWjWHQn +BKeDQU5Khvk6xdGXFxMBzhnuAqQd+lGwi8WiqXtGoVStR4utS4kdPS0JQpW7pQtWNfV he1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=N1Mdqy8Jnn61NAqYI4n51vqtWe1iyvQwfQk/kEedHuo=; b=acF4ksCv0EfFDaR6uHZ7HGhs1lmp0+06U2byPL5rMClYaoCQrbkZqqttrJYqiXkiC0 PQszgnna74/vJhuSDgmxmH63+HlvA4g4MyaJazWv6p3ZfEwv1k4+sjxT9+jgg6LT2CiL 4RxKlINuZq/Tb5gus+VxjINYgFnXfm2daxnvtlWhxtXbYnczkNE1P0aafoeQ7Rj2zySd 7dQxxSYcuaah1fMpMCf804O1Fj2aqhD73mXlymhJmt+zPcX1NHWVyDgD0hgEFo7BAWJ7 zvLvK9auLOKm4uLEfwseWonvMTVx/mPZ+KbwUiukFVJ0FpbgMmUwE3H0izBaSx6Om9aV +cgg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 24si27865091pfi.21.2019.04.27.02.55.25; Sat, 27 Apr 2019 02:55:42 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726209AbfD0Jyb (ORCPT + 99 others); Sat, 27 Apr 2019 05:54:31 -0400 Received: from relay13.nicmail.ru ([195.208.6.7]:39062 "EHLO relay13.nicmail.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725871AbfD0Jyb (ORCPT ); Sat, 27 Apr 2019 05:54:31 -0400 Received: from [109.70.25.215] (port=49504 helo=sghpc.hn.golosunov.pp.ru) by f17.mail.nic.ru with esmtp (Exim 5.55) (envelope-from ) id 1hKK2K-000JR2-6A; Sat, 27 Apr 2019 12:54:24 +0300 Received: from [5.164.181.148] (account sghpc@golosunov.pp.ru HELO sghpc.hn.golosunov.pp.ru) by proxy02.mail.nic.ru (Exim 5.55) with id 1hKK2K-0006Oi-0o; Sat, 27 Apr 2019 12:54:24 +0300 Received: from stepan by sghpc.hn.golosunov.pp.ru with local (Exim 4.89) (envelope-from ) id 1hKK2E-0007po-UT; Sat, 27 Apr 2019 13:54:19 +0400 Date: Sat, 27 Apr 2019 13:54:18 +0400 From: Stepan Golosunov To: Lukasz Majewski Cc: Arnd Bergmann , Thomas Gleixner , Joseph Myers , libc-alpha@sourceware.org, linux-api@vger.kernel.org, linux-kernel@vger.kernel.org, Deepa Dinamani Subject: Re: [PATCH 1/2] y2038: make CONFIG_64BIT_TIME unconditional Message-ID: <20190427095418.344yoomf5nwznatd@sghpc.golosunov.pp.ru> References: <20190426142531.1378357-1-arnd@arndb.de> <20190427004653.3cecd1cb@jawa> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190427004653.3cecd1cb@jawa> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 27.04.2019 ? 00:46:53 +0200 Lukasz Majewski ???????: > Hi Arnd, > > > As Stepan Golosunov points out, we made a small mistake in the > > get_timespec64() function in the kernel. It was originally added under > > the assumption that CONFIG_64BIT_TIME would get enabled on all 32-bit > > and 64-bit architectures, but when I did the conversion, I only turned > > it on for 32-bit ones. > > > > The effect is that the get_timespec64() function never clears the > > upper half of the tv_nsec field for 32-bit tasks in compat mode. > > Clearing this is required for POSIX compliant behavior of functions > > that pass a 'timespec' structure with a 64-bit tv_sec and a 32-bit > > tv_nsec, plus uninitialized padding. > At least for my setup (32bit ARM with 64 bit time support) this patch is > not fixing anything. The patch is not supposed to fix anything on 32-bit architectures as in-kernel struct timespec64 has 32-bit tv_nsec there. Thus truncation should happen automatically. I also missed that fact when I was reading get_timespec64 code. (I am wondering whether such trucation is undefined behaviour in C and whether there should be sign-extension instead of zeroing-out for the in_compat_syscall() case though.) > > The easiest fix for linux-5.1 is to just make the Kconfig symbol > > unconditional, as it was originally intended. As a follow-up, > > we should remove any #ifdef CONFIG_64BIT_TIME completely. > > > > Link: > > https://lore.kernel.org/lkml/20190422090710.bmxdhhankurhafxq@sghpc.golosunov.pp.ru/ > > Cc: Lukasz Majewski Cc: Stepan Golosunov > > Signed-off-by: Arnd Bergmann > > --- > > Please apply this one as a bugfix for 5.1 > > --- > > arch/Kconfig | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/arch/Kconfig b/arch/Kconfig > > index 33687dddd86a..9092e0ffe4d3 100644 > > --- a/arch/Kconfig > > +++ b/arch/Kconfig > > @@ -764,7 +764,7 @@ config COMPAT_OLD_SIGACTION > > bool > > > > config 64BIT_TIME > > - def_bool ARCH_HAS_64BIT_TIME > > + def_bool y > > help > > This should be selected by all architectures that need to > > support new system calls with a 64-bit time_t. This is relevant on > > all 32-bit