linux-stable/kernel/time
Willy Tarreau 583bcbc024 random32: update the net random state on interrupt and activity
commit f227e3ec3b upstream.

This modifies the first 32 bits out of the 128 bits of a random CPU's
net_rand_state on interrupt or CPU activity to complicate remote
observations that could lead to guessing the network RNG's internal
state.

Note that depending on some network devices' interrupt rate moderation
or binding, this re-seeding might happen on every packet or even almost
never.

In addition, with NOHZ some CPUs might not even get timer interrupts,
leaving their local state rarely updated, while they are running
networked processes making use of the random state.  For this reason, we
also perform this update in update_process_times() in order to at least
update the state when there is user or system activity, since it's the
only case we care about.

Reported-by: Amit Klein <aksecurity@gmail.com>
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Eric Dumazet <edumazet@google.com>
Cc: "Jason A. Donenfeld" <Jason@zx2c4.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Kees Cook <keescook@chromium.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-08-07 09:38:41 +02:00
..
alarmtimer.c alarmtimer: Unregister wakeup source when module get fails 2020-02-14 16:32:09 -05:00
clockevents.c clockevents: Make clockevents_config() static 2017-03-23 12:14:05 -07:00
clocksource.c clocksource: Prevent double add_timer_on() for watchdog_timer 2020-02-14 16:32:20 -05:00
hrtimer.c hrtimer: Annotate lockless access to timer->state 2020-01-04 14:00:08 +01:00
itimer.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
jiffies.c jiffies: Revert bogus conversion of NSEC_PER_SEC to TICK_NSEC 2017-03-07 11:03:28 +01:00
Kconfig rcu: Remove nohz_full full-system-idle state machine 2017-06-08 18:52:39 -07:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ntp.c ntp: Limit TAI-UTC offset 2019-07-31 07:28:27 +02:00
ntp_internal.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
posix-clock.c ptp: fix the race between the release of ptp_clock and cdev 2020-01-04 14:00:12 +01:00
posix-cpu-timers.c posix-cpu-timers: Unbreak timer rearming 2019-01-31 08:13:46 +01:00
posix-stubs.c posix-timers: Use get_timespec64() and put_timespec64() 2017-06-30 04:13:19 -04:00
posix-timers.c posix-timers: Fix division by zero bug 2018-12-29 13:39:09 +01:00
posix-timers.h posix-timers: Make forward callback return s64 2018-10-03 17:00:50 -07:00
sched_clock.c timers, sched_clock: Update timeout for clock wrap 2017-03-23 12:30:27 -07:00
test_udelay.c
tick-broadcast-hrtimer.c tick: broadcast-hrtimer: Fix a race in bc_set_next 2019-10-11 18:18:46 +02:00
tick-broadcast.c tick/broadcast: Use for_each_cpu() specially on UP kernels 2018-05-22 18:54:00 +02:00
tick-common.c ktime: Cleanup ktime_set() usage 2016-12-25 17:21:22 +01:00
tick-internal.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
tick-oneshot.c ktime: Get rid of the union 2016-12-25 17:21:22 +01:00
tick-sched.c tick/sched: Annotate lockless access to last_jiffies_update 2020-01-23 08:20:35 +01:00
tick-sched.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
time.c time: Make sure jiffies_to_msecs() preserves non-zero time periods 2018-07-03 11:24:56 +02:00
timeconst.bc time: Introduce jiffies64_to_nsecs() 2017-02-01 09:13:45 +01:00
timeconv.c
timecounter.c clocksource: Use a plain u64 instead of cycle_t 2016-12-25 11:04:12 +01:00
timekeeping.c timekeeping: Use proper seqcount initializer 2019-02-12 19:46:01 +01:00
timekeeping.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
timekeeping_debug.c PM / timekeeping: Print debug messages when requested 2017-07-23 00:03:43 +02:00
timekeeping_internal.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
timer.c random32: update the net random state on interrupt and activity 2020-08-07 09:38:41 +02:00
timer_list.c timer_list: Guard procfs specific code 2019-07-31 07:28:28 +02:00