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] [day] [month] [year] [list]
Date:	Wed, 27 May 2015 14:17:52 -0400 (EDT)
From:	David Miller <davem@...emloft.net>
To:	ruchandani.tina@...il.com
Cc:	arnd@...db.de, isdn@...ux-pingi.de, netdev@...r.kernel.org,
	y2038@...ts.linaro.org
Subject: Re: [PATCH v3] isdn: Use ktime_t instead of 'struct timeval'

From: Tina Ruchandani <ruchandani.tina@...il.com>
Date: Wed, 27 May 2015 06:52:12 +0530

> 'struct timeval' uses 32-bit representation for seconds which will
> overflow in year 2038 and beyond. mISDN/clock.c needs to compute and
> store elapsed time in intervals of 125 microseconds. This patch replaces
> the usage of 'struct timeval' with 64-bit ktime_t which is y2038 safe.
> The patch also replaces do_gettimeofday() (wall-clock time) with 
> ktime_get() (monotonic time) since we only care about elapsed time here.
> 
> Signed-off-by: Tina Ruchandani <ruchandani.tina@...il.com>
> Suggested-by: Arnd Bergmnann <arnd@...db.de>

This doesn't compile:

  CC [M]  drivers/isdn/mISDN/clock.o
In file included from include/linux/timer.h:5:0,
                 from include/linux/workqueue.h:8,
                 from include/linux/srcu.h:34,
                 from include/linux/notifier.h:15,
                 from include/linux/memory_hotplug.h:6,
                 from include/linux/mmzone.h:789,
                 from include/linux/gfp.h:5,
                 from include/linux/slab.h:14,
                 from drivers/isdn/mISDN/clock.c:36:
drivers/isdn/mISDN/clock.c: In function ‘mISDN_clock_update’:
drivers/isdn/mISDN/clock.c:175:10: error: ‘NS_PER_SEC’ undeclared (first use in this function)
         (NS_PER_SEC / 8000));
          ^
include/linux/ktime.h:181:51: note: in definition of macro ‘ktime_divns’
 # define ktime_divns(kt, div)  (u64)((kt).tv64 / (div))
                                                   ^
drivers/isdn/mISDN/clock.c:175:10: note: each undeclared identifier is reported only once for each function it appears in
         (NS_PER_SEC / 8000));
          ^
include/linux/ktime.h:181:51: note: in definition of macro ‘ktime_divns’
 # define ktime_divns(kt, div)  (u64)((kt).tv64 / (div))
                                                   ^
drivers/isdn/mISDN/clock.c: In function ‘mISDN_clock_get’:
drivers/isdn/mISDN/clock.c:199:53: error: ‘NS_PER_SEC’ undeclared (first use in this function)
  delta = ktime_divns(ktime_sub(tv_now, iclock_tv), (NS_PER_SEC / 8000));
                                                     ^
include/linux/ktime.h:181:51: note: in definition of macro ‘ktime_divns’
 # define ktime_divns(kt, div)  (u64)((kt).tv64 / (div))
 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ