RevolutionPi / piControl

Kernel module for data exchange with RevPi I/O-Modules and Gateways
81 stars 24 forks source link

piControl: use correct function to exchange data with userspace #48

Closed linosanfilippo-kunbus closed 2 years ago

linosanfilippo-kunbus commented 2 years ago

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