struct user_msghdr contains user pointers, so use the correct copy routine.
Signed-off-by: Tudor Cretu tudor.cretu@arm.com --- net/socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/socket.c b/net/socket.c index 741086ceff95d..0ac6d2a16808e 100644 --- a/net/socket.c +++ b/net/socket.c @@ -2418,7 +2418,7 @@ static int copy_msghdr_from_user(struct msghdr *kmsg, struct user_msghdr msg; ssize_t err;
- if (copy_from_user(&msg, umsg, sizeof(*umsg))) + if (copy_from_user_with_ptr(&msg, umsg, sizeof(*umsg))) return -EFAULT;
err = __copy_msghdr(kmsg, &msg, save_addr);