linux/kernel/time
Jason A. Donenfeld c6cf21d8d5 timekeeping: contribute wall clock to rng on time change
[ Upstream commit b8ac29b401 ]

The rng's random_init() function contributes the real time to the rng at
boot time, so that events can at least start in relation to something
particular in the real world. But this clock might not yet be set that
point in boot, so nothing is contributed. In addition, the relation
between minor clock changes from, say, NTP, and the cycle counter is
potentially useful entropic data.

This commit addresses this by mixing in a time stamp on calls to
settimeofday and adjtimex. No entropy is credited in doing so, so it
doesn't make initialization faster, but it is still useful input to
have.

Fixes: 1da177e4c3 ("Linux-2.6.12-rc2")
Cc: stable@vger.kernel.org
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-08-21 15:16:20 +02:00
..
alarmtimer.c
clockevents.c
clocksource.c clocksource: Avoid accidental unstable marking of clocksources 2022-01-27 10:54:06 +01:00
hrtimer.c wireguard: ratelimiter: use hrtimer in selftest 2022-08-21 15:15:52 +02:00
itimer.c
jiffies.c clocksource: Reduce clocksource-skew threshold 2022-01-27 10:54:05 +01:00
Kconfig
Makefile
namespace.c
ntp_internal.h
ntp.c
posix-clock.c
posix-cpu-timers.c posix-cpu-timers: Clear task::posix_cputimers_work in copy_process() 2021-11-18 14:04:29 +01:00
posix-stubs.c
posix-timers.c fix race between exit_itimers() and /proc/pid/timers 2022-07-21 21:19:59 +02:00
posix-timers.h
sched_clock.c
test_udelay.c
tick-broadcast-hrtimer.c
tick-broadcast.c
tick-common.c
tick-internal.h hrtimer: Ensure timerfd notification for HIGHRES=n 2021-09-15 09:50:25 +02:00
tick-oneshot.c
tick-sched.c tick/nohz: unexport __init-annotated tick_nohz_full_setup() 2022-07-02 16:39:23 +02:00
tick-sched.h
time.c
timeconst.bc
timeconv.c
timecounter.c
timekeeping_debug.c
timekeeping_internal.h
timekeeping.c timekeeping: contribute wall clock to rng on time change 2022-08-21 15:16:20 +02:00
timekeeping.h
timer_list.c
timer.c timers: Fix warning condition in __run_timers() 2022-04-20 09:23:30 +02:00
vsyscall.c