Skip to content
Commit daf6cd0c authored by Elias Vanderstuyft's avatar Elias Vanderstuyft Committed by Dmitry Torokhov
Browse files

Input: uinput - sanity check on ff_effects_max and EV_FF



Currently the user can set ff_effects_max to zero with the EV_FF bit (and
the FF_GAIN and/or FF_AUTOCENTER bits) set, in this case the uninitialized
methods ff->set_gain and/or ff->set_autocenter can be dereferenced,
resulting in a kernel oops.

Check in uinput_create_device() and print a helpful message and return
-EINVAL in case the check fails.

Signed-off-by: default avatarElias Vanderstuyft <elias.vds@gmail.com>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent fbae10db
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment