]> git.baikalelectronics.ru Git - kernel.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)
committerDavid S. Miller <davem@davemloft.net>
Fri, 18 Oct 2013 17:20:42 +0000 (13:20 -0400)
commit25ded7dfe4e3a44c7f710e3c552cd595a453233c
treedf4a2c33ac2bfda18393fe56500fd0cb58551351
parent665edf44303165449fa0573697732d1a2f49ec70
tipc: don't use memcpy to copy from user space

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>
net/tipc/msg.c