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]
Message-ID: <CALAqxLU0XnQfmPLOVqRtv0z_jU6kDFdK6rkfBNh11Ri-q5gPqw@mail.gmail.com>
Date:	Wed, 8 Jul 2015 13:09:55 -0700
From:	John Stultz <john.stultz@...aro.org>
To:	Bamvor Zhang Jian <bamvor.zhangjian@...aro.org>
Cc:	Arnd Bergmann <arnd@...db.de>,
	Thomas Gleixner <tglx@...utronix.de>, y2039@...ts.linaro.org,
	lkml <linux-kernel@...r.kernel.org>,
	Baolin Wang <baolin.wang@...aro.org>
Subject: Re: [RFC PATCH v2 1/4] y2038: add 64bit time_t support in timeval for
 32bit architecture

On Mon, Jun 29, 2015 at 7:23 AM, Bamvor Zhang Jian
<bamvor.zhangjian@...aro.org> wrote:
> +int get_timeval64(struct timeval64 *tv,
> +                  const struct __kernel_timeval __user *utv)
> +{
> +       struct __kernel_timeval ktv;
> +       int ret;
> +
> +       ret = copy_from_user(&ktv, utv, sizeof(ktv));
> +       if (ret)
> +               return -EFAULT;
> +
> +       tv->tv_sec = ktv.tv_sec;
> +       if (!IS_ENABLED(CONFIG_64BIT)
> +#ifdef CONFIG_COMPAT
> +          || is_compat_task()
> +#endif

These sorts of ifdefs are to be avoided inside of functions.

Instead, it seems is_compat_task() should be defined to 0 in the
!CONFIG_COMPAT case, so you can avoid the ifdefs and the compiler can
still optimize it out.

Otherwise this looks similar to a patch Baolin (cc'ed) has been working on.

thanks
-john
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ