]> git.ipfire.org Git - people/ms/linux.git/commit
tipc: don't use memcpy to copy from user space
authorYing Xue <ying.xue@windriver.com>
Fri, 18 Oct 2013 05:23:14 +0000 (07:23 +0200)
committerJiri Slaby <jslaby@suse.cz>
Tue, 26 Aug 2014 12:12:22 +0000 (14:12 +0200)
commit56cf7e077c081a5874dcbd722cbae771bb5177fc
tree8365150d373462d14a0d9937485ad30a02e3d579
parente0c516a109e873556edd487912c62bc39ad5c9ce
tipc: don't use memcpy to copy from user space

commit 5c0a0fc81f4dc786b42c4fc9c7c72ba635406ab5 upstream.

tipc_msg_build() calls skb_copy_to_linear_data_offset() to copy data
from user space to kernel space. However, the latter function does
in its turn call memcpy() to perform the actual copying. This poses
an obvious security and robustness risk, since memcpy() never makes
any validity check on the pointer it is copying from.

To correct this, we the replace the offending function call with
a call to memcpy_fromiovecend(), which uses copy_from_user() to
perform the copying.

Signed-off-by: Ying Xue <ying.xue@windriver.com>
Reviewed-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
net/tipc/msg.c