Re: [PATCH] hpet: Fix division by zero in hpet_time_div()

2019-07-11 Thread Kefeng Wang
On 2019/7/11 20:32, Arnd Bergmann wrote: > On Thu, Jul 11, 2019 at 1:20 PM Kefeng Wang > wrote: >> The base value in do_div() called by hpet_time_div() is truncated from >> unsigned long to uint32_t, resulting in a divide-by-zero exception. > > Good catch! > >> --- a/drivers/char/hpet.c >> +

Re: [PATCH] hpet: Fix division by zero in hpet_time_div()

2019-07-11 Thread Arnd Bergmann
On Thu, Jul 11, 2019 at 1:20 PM Kefeng Wang wrote: > The base value in do_div() called by hpet_time_div() is truncated from > unsigned long to uint32_t, resulting in a divide-by-zero exception. Good catch! > --- a/drivers/char/hpet.c > +++ b/drivers/char/hpet.c > @@ -567,7 +567,7 @@ static inlin

[PATCH] hpet: Fix division by zero in hpet_time_div()

2019-07-11 Thread Kefeng Wang
The base value in do_div() called by hpet_time_div() is truncated from unsigned long to uint32_t, resulting in a divide-by-zero exception. UBSAN: Undefined behaviour in ../drivers/char/hpet.c:572:2 division by zero CPU: 1 PID: 23682 Comm: syz-executor.3 Not tainted 4.4.184.x86_64+ #4 Hardware name