Do not use combinations of access_ok() and copy_from_user() or
copy_to_user() as replacements for copy_from_user() and copy_to_user().
As pointed out by Lukas Wunner these functions do not perform all the
necessary checks needed to exchange data areas with userspace (see also
this comment of Linus Torvalds:
http://lkml.iu.edu/hypermail/linux/kernel/2007.3/06760.html).
So instead use copy_from_user() and copy_to_user().
Signed-off-by: Lino Sanfilippo l.sanfilippo@kunbus.com
Fixes: a5b39ae638fe ("piControl: Fix data copy for ioctl KB_GET_DEVICE_INFO")
Reported-by: Lukas Wunner lukas@wunner.de
Do not use combinations of access_ok() and copy_from_user() or copy_to_user() as replacements for copy_from_user() and copy_to_user(). As pointed out by Lukas Wunner these functions do not perform all the necessary checks needed to exchange data areas with userspace (see also this comment of Linus Torvalds: http://lkml.iu.edu/hypermail/linux/kernel/2007.3/06760.html).
So instead use copy_from_user() and copy_to_user().
Signed-off-by: Lino Sanfilippo l.sanfilippo@kunbus.com Fixes: a5b39ae638fe ("piControl: Fix data copy for ioctl KB_GET_DEVICE_INFO") Reported-by: Lukas Wunner lukas@wunner.de