diff options
author | Arnd Bergmann <arnd@arndb.de> | 2018-07-11 12:40:36 +0300 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2018-07-16 01:43:12 +0300 |
commit | 7bb497092a34a2bbb16bad5385a0487dee18a769 (patch) | |
tree | c7daa347584333471e88fecca7b708583e9ab78a /.gitattributes | |
parent | 3eb420e70d879ce0e6bf752accf5cdedb0a59de8 (diff) | |
download | linux-7bb497092a34a2bbb16bad5385a0487dee18a769.tar.xz |
efi/cper: Avoid using get_seconds()
get_seconds() is deprecated because of the 32-bit time overflow
in y2038/y2106 on 32-bit architectures. The way it is used in
cper_next_record_id() causes an overflow in 2106 when unsigned UTC
seconds overflow, even on 64-bit architectures.
This starts using ktime_get_real_seconds() to give us more than 32 bits
of timestamp on all architectures, and then changes the algorithm to use
39 bits for the timestamp after the y2038 wrap date, plus an always-1
bit at the top. This gives us another 127 epochs of 136 years, with
strictly monotonically increasing sequence numbers across boots.
This is almost certainly overkill, but seems better than just extending
the deadline from 2038 to 2106.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-efi@vger.kernel.org
Link: http://lkml.kernel.org/r/20180711094040.12506-5-ard.biesheuvel@linaro.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to '.gitattributes')
0 files changed, 0 insertions, 0 deletions