Re: [PATCH] HID: core: detect and skip invalid inputs to snto32()

2021-01-08 Thread Jiri Kosina
On Wed, 16 Dec 2020, Randy Dunlap wrote: > Prevent invalid (0, 0) inputs to hid-core's snto32() function. > > Maybe it is just the dummy device here that is causing this, but > there are hundreds of calls to snto32(0, 0). Having n (bits count) > of 0 is causing the current UBSAN trap with a shift

[PATCH] HID: core: detect and skip invalid inputs to snto32()

2020-12-16 Thread Randy Dunlap
Prevent invalid (0, 0) inputs to hid-core's snto32() function. Maybe it is just the dummy device here that is causing this, but there are hundreds of calls to snto32(0, 0). Having n (bits count) of 0 is causing the current UBSAN trap with a shift value of 0x (-1, or n - 1 in this function)