Skip to content

Commit ffe6da9

Browse files
committed
Merge tag 'timers-urgent-2020-03-15' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull timer fix from Thomas Gleixner: "A single fix adding the missing time namespace adjustment in sys/sysinfo which caused sys/sysinfo to be inconsistent with /proc/uptime when read from a task inside a time namespace" * tag 'timers-urgent-2020-03-15' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: sys/sysinfo: Respect boottime inside time namespace
2 parents 52ac377 + ecc421e commit ffe6da9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

kernel/sys.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
#include <linux/syscalls.h>
4848
#include <linux/kprobes.h>
4949
#include <linux/user_namespace.h>
50+
#include <linux/time_namespace.h>
5051
#include <linux/binfmts.h>
5152

5253
#include <linux/sched.h>
@@ -2546,6 +2547,7 @@ static int do_sysinfo(struct sysinfo *info)
25462547
memset(info, 0, sizeof(struct sysinfo));
25472548

25482549
ktime_get_boottime_ts64(&tp);
2550+
timens_add_boottime(&tp);
25492551
info->uptime = tp.tv_sec + (tp.tv_nsec ? 1 : 0);
25502552

25512553
get_avenrun(info->loads, 0, SI_LOAD_SHIFT - FSHIFT);

0 commit comments

Comments
 (0)