]> git.baikalelectronics.ru Git - kernel.git/commit
um: ubd: use 64-bit time_t where possible
authorArnd Bergmann <arnd@arndb.de>
Tue, 5 Nov 2019 08:39:51 +0000 (09:39 +0100)
committerArnd Bergmann <arnd@arndb.de>
Wed, 18 Dec 2019 17:07:31 +0000 (18:07 +0100)
commitd00fd99c11d73b2ec408cfa803a6d09acd1b57f9
treece5ecd2529f48e2b4544b88bf06bc09debd0c4db
parentffc8ac2b3969faa086fff87cc7a2a194f9b11f71
um: ubd: use 64-bit time_t where possible

The ubd code suffers from a possible y2038 overflow on 32-bit
architectures, both for the cow header and the os_file_modtime()
function.

Replace time_t with time64_t to extend the ubd_kern side as much
as possible.

Whether this makes a difference for the user side depends on
the host libc implementation that may use either 32-bit or 64-bit
time_t.

For the cow file format, the header contains an unsigned 32-bit
timestamp, which is good until y2106, passing this through a
'long long' gives us a consistent interpretation between 32-bit
and 64-bit um kernels.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
arch/um/drivers/cow.h
arch/um/drivers/cow_user.c
arch/um/drivers/ubd_kern.c
arch/um/include/shared/os.h
arch/um/os-Linux/file.c