]> git.baikalelectronics.ru Git - kernel.git/commit
tomoyo: fix timestamping for y2038
authorArnd Bergmann <arnd@arndb.de>
Thu, 19 Oct 2017 12:29:04 +0000 (14:29 +0200)
committerJames Morris <james.l.morris@oracle.com>
Sat, 21 Oct 2017 02:21:06 +0000 (06:21 +0400)
commitc3059d87a10891eb11109d8bf20d960c125b45b7
tree8e48e194ded6863826462df91a837925bca559df
parent49f101dca50c9cc700dc9c6f8460660d854266b8
tomoyo: fix timestamping for y2038

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 <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: James Morris <james.l.morris@oracle.com>
security/tomoyo/audit.c
security/tomoyo/common.c
security/tomoyo/common.h
security/tomoyo/util.c