From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752845AbdJUCWw (ORCPT ); Fri, 20 Oct 2017 22:22:52 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:24273 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751628AbdJUCWv (ORCPT ); Fri, 20 Oct 2017 22:22:51 -0400 Date: Sat, 21 Oct 2017 06:22:30 +0400 (+04) From: James Morris X-X-Sender: james.l.morris@t440 To: Arnd Bergmann cc: Kentaro Takeda , Tetsuo Handa , "Serge E. Hallyn" , Ingo Molnar , linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] [v2] tomoyo: fix timestamping for y2038 In-Reply-To: <20171019122919.1263808-1-arnd@arndb.de> Message-ID: References: <20171019122919.1263808-1-arnd@arndb.de> User-Agent: Alpine 2.20 (LFD 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Source-IP: userv0021.oracle.com [156.151.31.71] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 19 Oct 2017, Arnd Bergmann wrote: > Tomoyo uses an open-coded version of time_to_tm() to create a timestamp > from the current time as read by get_seconds(). This will overflow and > give wrong results on 32-bit systems in 2038. > > To correct this, this changes the code to use ktime_get_real_seconds() > and the generic time64_to_tm() function that are both y2038-safe. > Using the library function avoids adding an expensive 64-bit division > in this code and can benefit from any optimizations we do in common > code. > > Acked-by: Tetsuo Handa > Signed-off-by: Arnd Bergmann > --- > v2: fix year calculation Applied to: git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security.git next-general -- James Morris From mboxrd@z Thu Jan 1 00:00:00 1970 From: james.l.morris@oracle.com (James Morris) Date: Sat, 21 Oct 2017 06:22:30 +0400 (+04) Subject: [PATCH] [v2] tomoyo: fix timestamping for y2038 In-Reply-To: <20171019122919.1263808-1-arnd@arndb.de> References: <20171019122919.1263808-1-arnd@arndb.de> Message-ID: To: linux-security-module@vger.kernel.org List-Id: linux-security-module.vger.kernel.org On Thu, 19 Oct 2017, Arnd Bergmann wrote: > Tomoyo uses an open-coded version of time_to_tm() to create a timestamp > from the current time as read by get_seconds(). This will overflow and > give wrong results on 32-bit systems in 2038. > > To correct this, this changes the code to use ktime_get_real_seconds() > and the generic time64_to_tm() function that are both y2038-safe. > Using the library function avoids adding an expensive 64-bit division > in this code and can benefit from any optimizations we do in common > code. > > Acked-by: Tetsuo Handa > Signed-off-by: Arnd Bergmann > --- > v2: fix year calculation Applied to: git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security.git next-general -- James Morris -- To unsubscribe from this list: send the line "unsubscribe linux-security-module" in the body of a message to majordomo at vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html