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  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, 20 Oct 2014 15:07:50 +0400
From:	Andrey Ryabinin <>
To:	Thomas Gleixner <>
Cc:	Andrew Morton <>,
	Ingo Molnar <>,
	"H. Peter Anvin" <>,
	Peter Zijlstra <>,
	Michal Marek <>,
	Sasha Levin <>,,,,
	Theodore Ts'o <>,
	Andreas Dilger <>,
	Dmitry Vyukov <>,
	Konstantin Khlebnikov <>
Subject: kernel: clockevents: shift out-of-bounds

On kernel with UBSan enabled I've got following:

     UBSan: Undefined behaviour in ../kernel/time/clockevents.c:75:34
     shift exponent 32 is to large for 32-bit type 'unsigned int'
     CPU: 0 PID: 0 Comm: swapper/0 Not tainted 3.17.0-rc7+ #39
     Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 04/01/2014
      0000000000000000 0000000000000000 0000000000000001 ffffffff83003db0
      ffffffff82a30940 0000000000000020 ffffffff83003dc0 ffffffff819502e9
      ffffffff83003e40 ffffffff81950735 ffff88013f003233 0000000000000000
     Call Trace:
     dump_stack (/home/andrew/linux/lib/dump_stack.c:52)
     ubsan_epilogue (/home/andrew/linux/lib/ubsan.c:122)
     __ubsan_handle_shift_out_of_bounds (/home/andrew/linux/lib/ubsan.c:390)
     ? hpet_enable (/home/andrew/linux/arch/x86/kernel/hpet.c:862)
     cev_delta2ns (/home/andrew/linux/kernel/time/clockevents.c:75 (discriminator 1))
     clockevents_config.part.2 (/home/andrew/linux/kernel/time/clockevents.c:421)
     ? __clocksource_select (/home/andrew/linux/kernel/time/clocksource.c:607 /home/andrew/linux/kernel/time/clocksource.c:631)
     clockevents_config_and_register (/home/andrew/linux/kernel/time/clockevents.c:440)
     hpet_enable (/home/andrew/linux/arch/x86/kernel/hpet.c:305 /home/andrew/linux/arch/x86/kernel/hpet.c:891)
     hpet_time_init (/home/andrew/linux/arch/x86/kernel/time.c:79)
     x86_late_time_init (/home/andrew/linux/arch/x86/kernel/time.c:87)
     start_kernel (/home/andrew/linux/init/main.c:637)
     ? early_idt_handlers (/home/andrew/linux/arch/x86/kernel/head_64.S:344)
     x86_64_start_reservations (/home/andrew/linux/arch/x86/kernel/head64.c:194)
     x86_64_start_kernel (/home/andrew/linux/arch/x86/kernel/head64.c:183)

I guess it should be 1ULL here instead of 1U:
            (!ismax || evt->mult <= (1U << evt->shift)))

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

Powered by blists - more mailing lists