Commit 5b1c071d authored by Benjamin Tissoires's avatar Benjamin Tissoires Committed by Greg Kroah-Hartman
Browse files

HID: hidraw: tighten ioctl command parsing



[ Upstream commit 75d5546f ]

The handling for variable-length ioctl commands in hidraw_ioctl() is
rather complex and the check for the data direction is incomplete.

Simplify this code by factoring out the various ioctls grouped by dir
and size, and using a switch() statement with the size masked out, to
ensure the rest of the command is correctly matched.

Fixes: 9188e79e ("HID: add phys and name ioctls to hidraw")
Reported-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarBenjamin Tissoires <bentiss@kernel.org>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 582e8290
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment