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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 31 Jul 2017 16:09:53 +0200
From:   Arnd Bergmann <arnd@...db.de>
To:     Deepa Dinamani <deepa.kernel@...il.com>
Cc:     Al Viro <viro@...iv.linux.org.uk>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Linux FS-devel Mailing List <linux-fsdevel@...r.kernel.org>,
        y2038 Mailman List <y2038@...ts.linaro.org>
Subject: Re: [PATCH v2 4/6] ipc: sem: Make sem_array timestamps y2038 safe

On Mon, Jul 31, 2017 at 12:30 AM, Deepa Dinamani <deepa.kernel@...il.com> wrote:
> time_t is not y2038 safe. Replace all uses of
> time_t by y2038 safe time64_t.
>
> Similarly, replace the calls to get_seconds() with
> y2038 safe ktime_get_real_seconds().
> Note that this preserves fast access on 64 bit systems,
> but 32 bit systems need sequence counters.
>
> The syscall interface themselves are not changed as part of
> the patch. They will be part of a different series.
>
> Signed-off-by: Deepa Dinamani <deepa.kernel@...il.com>

Looks good. One detail:

> @@ -2310,7 +2310,7 @@ static int sysvipc_sem_proc_show(struct seq_file *s, void *it)
>         sem_otime = get_semotime(sma);
>
>         seq_printf(s,
> -                  "%10d %10d  %4o %10u %5u %5u %5u %5u %10lu %10lu\n",
> +                  "%10d %10d  %4o %10u %5u %5u %5u %5u %10llu %10llu\n",
>                    sma->sem_perm.key,
>                    sma->sem_perm.id,
>                    sma->sem_perm.mode,
> @@ -2319,8 +2319,8 @@ static int sysvipc_sem_proc_show(struct seq_file *s, void *it)
>                    from_kgid_munged(user_ns, sma->sem_perm.gid),
>                    from_kuid_munged(user_ns, sma->sem_perm.cuid),
>                    from_kgid_munged(user_ns, sma->sem_perm.cgid),
> -                  sem_otime,
> -                  sma->sem_ctime);
> +                  (unsigned long long) sem_otime,
> +                  (unsigned long long) sma->sem_ctime);
>

Unless I'm missing something here, you can drop the cast to
unsigned long long: time64_t is always 'long long' and won't
cause a warning here.

We only need a cast like this when printing the members of 'struct
 timespec64', since that can be either 'long long' or 'long', when
it is defined as an alias for timespec.

        Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ