lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 3 Mar 2020 16:40:56 +0000
From:   Dmitry Safonov <dima@...sta.com>
To:     Cyril Hrubis <chrubis@...e.cz>, linux-kernel@...r.kernel.org
Cc:     Andrei Vagin <avagin@...nvz.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Jiri Bohac <jbohac@...e.cz>
Subject: Re: [PATCH] sys/sysinfo: Respect boottime inside time namespace

On 3/3/20 3:06 PM, Cyril Hrubis wrote:
> The sysinfo() syscall includes uptime in seconds this makes it
> consistent with the /proc/uptime inside of a time namespace.
> 
> Signed-off-by: Cyril Hrubis <chrubis@...e.cz>

Reviewed-by: Dmitry Safonov <dima@...sta.com>

> ---
>  kernel/sys.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/kernel/sys.c b/kernel/sys.c
> index f9bc5c303e3f..d325f3ab624a 100644
> --- a/kernel/sys.c
> +++ b/kernel/sys.c
> @@ -47,6 +47,7 @@
>  #include <linux/syscalls.h>
>  #include <linux/kprobes.h>
>  #include <linux/user_namespace.h>
> +#include <linux/time_namespace.h>
>  #include <linux/binfmts.h>
>  
>  #include <linux/sched.h>
> @@ -2546,6 +2547,7 @@ static int do_sysinfo(struct sysinfo *info)
>  	memset(info, 0, sizeof(struct sysinfo));
>  
>  	ktime_get_boottime_ts64(&tp);
> +	timens_add_boottime(&tp);
>  	info->uptime = tp.tv_sec + (tp.tv_nsec ? 1 : 0);
>  
>  	get_avenrun(info->loads, 0, SI_LOAD_SHIFT - FSHIFT);
> 

Thanks for noticing,
          Dmitry

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ