[Bug 261781] vdso: Time calculation integer overflow

From: <bugzilla-noreply_at_freebsd.org>
Date: Tue, 08 Feb 2022 19:16:57 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=261781

--- Comment #3 from Konstantin Belousov <kib@FreeBSD.org> ---
I see, do you mean the following:
diff --git a/lib/libc/sys/__vdso_gettimeofday.c
b/lib/libc/sys/__vdso_gettimeofday.c
index c1457a54d37e..cf1400cdf291 100644
--- a/lib/libc/sys/__vdso_gettimeofday.c
+++ b/lib/libc/sys/__vdso_gettimeofday.c
@@ -83,9 +83,9 @@ binuptime(struct bintime *bt, struct vdso_timekeep *tk, bool
abs)
         return (error);
      scale = th->th_scale;
 #ifdef _LP64
-    scale_bits = ffsl(scale);
+     scale_bits = flsl(scale);
 #else
-    scale_bits = ffsll(scale);
+     scale_bits = flsll(scale);
 #endif
      if (__predict_false(scale_bits + fls(delta) > 63)) {
         x = (scale >> 32) * delta;

-- 
You are receiving this mail because:
You are the assignee for the bug.