mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [patch 0/2] timers: Prevent multiplication overflow in timespec/val conversions
@ 2017-06-20 15:37 Thomas Gleixner
  2017-06-20 15:37 ` [patch 1/2] itimer: Make timeval to nsec conversion range limited Thomas Gleixner
  2017-06-20 15:37 ` [patch 2/2] posix-cpu-timers: Make timespec to nsec conversion safe Thomas Gleixner
  0 siblings, 2 replies; 5+ messages in thread
From: Thomas Gleixner @ 2017-06-20 15:37 UTC (permalink / raw)
  To: LKML; +Cc: John Stultz, Peter Zijlstra, Xishi Qiu

KASAN detected a multiplication overflow in the sys_setitimer() timeval
conversion. The same issue is possible the posix-cpu-timer sys_timer_set()
implementation.

In both cases the conversion of the tv_sec part overflows when multiplied
with NSEC_PER_SEC, i.e. 1e9.

This can be mitigated by using the timespec/val_to_ktime() helper, which
prevents the overflow and clamps the result to KTIME_MAX (~292 years).

Thanks,

	tglx

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-06-20 19:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-20 15:37 [patch 0/2] timers: Prevent multiplication overflow in timespec/val conversions Thomas Gleixner
2017-06-20 15:37 ` [patch 1/2] itimer: Make timeval to nsec conversion range limited Thomas Gleixner
2017-06-20 19:39   ` [tip:timers/core] " tip-bot for Thomas Gleixner
2017-06-20 15:37 ` [patch 2/2] posix-cpu-timers: Make timespec to nsec conversion safe Thomas Gleixner
2017-06-20 19:40   ` [tip:timers/core] " tip-bot for Thomas Gleixner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome