diff options
36 files changed, 57 insertions, 57 deletions
diff --git a/crypto/algif_skcipher.c b/crypto/algif_skcipher.c index 83187f497c7c..c3b482bee208 100644 --- a/crypto/algif_skcipher.c +++ b/crypto/algif_skcipher.c | |||
@@ -298,9 +298,9 @@ static int skcipher_sendmsg(struct kiocb *unused, struct socket *sock, | |||
298 | len = min_t(unsigned long, len, | 298 | len = min_t(unsigned long, len, |
299 | PAGE_SIZE - sg->offset - sg->length); | 299 | PAGE_SIZE - sg->offset - sg->length); |
300 | 300 | ||
301 | err = memcpy_fromiovec(page_address(sg_page(sg)) + | 301 | err = memcpy_from_msg(page_address(sg_page(sg)) + |
302 | sg->offset + sg->length, | 302 | sg->offset + sg->length, |
303 | msg->msg_iov, len); | 303 | msg, len); |
304 | if (err) | 304 | if (err) |
305 | goto unlock; | 305 | goto unlock; |
306 | 306 | ||
@@ -337,8 +337,8 @@ static int skcipher_sendmsg(struct kiocb *unused, struct socket *sock, | |||
337 | if (!sg_page(sg + i)) | 337 | if (!sg_page(sg + i)) |
338 | goto unlock; | 338 | goto unlock; |
339 | 339 | ||
340 | err = memcpy_fromiovec(page_address(sg_page(sg + i)), | 340 | err = memcpy_from_msg(page_address(sg_page(sg + i)), |
341 | msg->msg_iov, plen); | 341 | msg, plen); |
342 | if (err) { | 342 | if (err) { |
343 | __free_page(sg_page(sg + i)); | 343 | __free_page(sg_page(sg + i)); |
344 | sg_assign_page(sg + i, NULL); | 344 | sg_assign_page(sg + i, NULL); |
diff --git a/drivers/isdn/mISDN/socket.c b/drivers/isdn/mISDN/socket.c index dcbd8589f0c4..84b35925ee4d 100644 --- a/drivers/isdn/mISDN/socket.c +++ b/drivers/isdn/mISDN/socket.c | |||
@@ -203,7 +203,7 @@ mISDN_sock_sendmsg(struct kiocb *iocb, struct socket *sock, | |||
203 | if (!skb) | 203 | if (!skb) |
204 | goto done; | 204 | goto done; |
205 | 205 | ||
206 | if (memcpy_fromiovec(skb_put(skb, len), msg->msg_iov, len)) { | 206 | if (memcpy_from_msg(skb_put(skb, len), msg, len)) { |
207 | err = -EFAULT; | 207 | err = -EFAULT; |
208 | goto done; | 208 | goto done; |
209 | } | 209 | } |
diff --git a/drivers/net/ppp/pppoe.c b/drivers/net/ppp/pppoe.c index 443cbbf5c55f..d2408a5e43a6 100644 --- a/drivers/net/ppp/pppoe.c +++ b/drivers/net/ppp/pppoe.c | |||
@@ -869,7 +869,7 @@ static int pppoe_sendmsg(struct kiocb *iocb, struct socket *sock, | |||
869 | ph = (struct pppoe_hdr *)skb_put(skb, total_len + sizeof(struct pppoe_hdr)); | 869 | ph = (struct pppoe_hdr *)skb_put(skb, total_len + sizeof(struct pppoe_hdr)); |
870 | start = (char *)&ph->tag[0]; | 870 | start = (char *)&ph->tag[0]; |
871 | 871 | ||
872 | error = memcpy_fromiovec(start, m->msg_iov, total_len); | 872 | error = memcpy_from_msg(start, m, total_len); |
873 | if (error < 0) { | 873 | if (error < 0) { |
874 | kfree_skb(skb); | 874 | kfree_skb(skb); |
875 | goto end; | 875 | goto end; |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index cbe4b2078b30..97dc5f8123b3 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -2687,6 +2687,11 @@ int skb_ensure_writable(struct sk_buff *skb, int write_len); | |||
2687 | int skb_vlan_pop(struct sk_buff *skb); | 2687 | int skb_vlan_pop(struct sk_buff *skb); |
2688 | int skb_vlan_push(struct sk_buff *skb, __be16 vlan_proto, u16 vlan_tci); | 2688 | int skb_vlan_push(struct sk_buff *skb, __be16 vlan_proto, u16 vlan_tci); |
2689 | 2689 | ||
2690 | static inline int memcpy_from_msg(void *data, struct msghdr *msg, int len) | ||
2691 | { | ||
2692 | return memcpy_fromiovec(data, msg->msg_iov, len); | ||
2693 | } | ||
2694 | |||
2690 | struct skb_checksum_ops { | 2695 | struct skb_checksum_ops { |
2691 | __wsum (*update)(const void *mem, int len, __wsum wsum); | 2696 | __wsum (*update)(const void *mem, int len, __wsum wsum); |
2692 | __wsum (*combine)(__wsum csum, __wsum csum2, int offset, int len); | 2697 | __wsum (*combine)(__wsum csum, __wsum csum2, int offset, int len); |
diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h index 72a31db47ded..487ef34bbd63 100644 --- a/include/net/sctp/sm.h +++ b/include/net/sctp/sm.h | |||
@@ -219,7 +219,7 @@ struct sctp_chunk *sctp_make_abort_no_data(const struct sctp_association *, | |||
219 | const struct sctp_chunk *, | 219 | const struct sctp_chunk *, |
220 | __u32 tsn); | 220 | __u32 tsn); |
221 | struct sctp_chunk *sctp_make_abort_user(const struct sctp_association *, | 221 | struct sctp_chunk *sctp_make_abort_user(const struct sctp_association *, |
222 | const struct msghdr *, size_t msg_len); | 222 | struct msghdr *, size_t msg_len); |
223 | struct sctp_chunk *sctp_make_abort_violation(const struct sctp_association *, | 223 | struct sctp_chunk *sctp_make_abort_violation(const struct sctp_association *, |
224 | const struct sctp_chunk *, | 224 | const struct sctp_chunk *, |
225 | const __u8 *, | 225 | const __u8 *, |
diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c index 425942db17f6..0d0766ea5ab1 100644 --- a/net/appletalk/ddp.c +++ b/net/appletalk/ddp.c | |||
@@ -1659,7 +1659,7 @@ static int atalk_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr | |||
1659 | 1659 | ||
1660 | SOCK_DEBUG(sk, "SK %p: Copy user data (%Zd bytes).\n", sk, len); | 1660 | SOCK_DEBUG(sk, "SK %p: Copy user data (%Zd bytes).\n", sk, len); |
1661 | 1661 | ||
1662 | err = memcpy_fromiovec(skb_put(skb, len), msg->msg_iov, len); | 1662 | err = memcpy_from_msg(skb_put(skb, len), msg, len); |
1663 | if (err) { | 1663 | if (err) { |
1664 | kfree_skb(skb); | 1664 | kfree_skb(skb); |
1665 | err = -EFAULT; | 1665 | err = -EFAULT; |
diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c index f4f835e19378..ca049a7c9287 100644 --- a/net/ax25/af_ax25.c +++ b/net/ax25/af_ax25.c | |||
@@ -1549,7 +1549,7 @@ static int ax25_sendmsg(struct kiocb *iocb, struct socket *sock, | |||
1549 | skb_reserve(skb, size - len); | 1549 | skb_reserve(skb, size - len); |
1550 | 1550 | ||
1551 | /* User data follows immediately after the AX.25 data */ | 1551 | /* User data follows immediately after the AX.25 data */ |
1552 | if (memcpy_fromiovec(skb_put(skb, len), msg->msg_iov, len)) { | 1552 | if (memcpy_from_msg(skb_put(skb, len), msg, len)) { |
1553 | err = -EFAULT; | 1553 | err = -EFAULT; |
1554 | kfree_skb(skb); | 1554 | kfree_skb(skb); |
1555 | goto out; | 1555 | goto out; |
diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c index 5e2cd2535978..2c245fdf319a 100644 --- a/net/bluetooth/hci_sock.c +++ b/net/bluetooth/hci_sock.c | |||
@@ -947,7 +947,7 @@ static int hci_sock_sendmsg(struct kiocb *iocb, struct socket *sock, | |||
947 | if (!skb) | 947 | if (!skb) |
948 | goto done; | 948 | goto done; |
949 | 949 | ||
950 | if (memcpy_fromiovec(skb_put(skb, len), msg->msg_iov, len)) { | 950 | if (memcpy_from_msg(skb_put(skb, len), msg, len)) { |
951 | err = -EFAULT; | 951 | err = -EFAULT; |
952 | goto drop; | 952 | goto drop; |
953 | } | 953 | } |
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index cbeef5f62f3b..f3e4a16fb157 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c | |||
@@ -5767,7 +5767,7 @@ int mgmt_control(struct sock *sk, struct msghdr *msg, size_t msglen) | |||
5767 | if (!buf) | 5767 | if (!buf) |
5768 | return -ENOMEM; | 5768 | return -ENOMEM; |
5769 | 5769 | ||
5770 | if (memcpy_fromiovec(buf, msg->msg_iov, msglen)) { | 5770 | if (memcpy_from_msg(buf, msg, msglen)) { |
5771 | err = -EFAULT; | 5771 | err = -EFAULT; |
5772 | goto done; | 5772 | goto done; |
5773 | } | 5773 | } |
diff --git a/net/bluetooth/rfcomm/sock.c b/net/bluetooth/rfcomm/sock.c index 8bbbb5ec468c..2348176401a0 100644 --- a/net/bluetooth/rfcomm/sock.c +++ b/net/bluetooth/rfcomm/sock.c | |||
@@ -588,7 +588,7 @@ static int rfcomm_sock_sendmsg(struct kiocb *iocb, struct socket *sock, | |||
588 | } | 588 | } |
589 | skb_reserve(skb, RFCOMM_SKB_HEAD_RESERVE); | 589 | skb_reserve(skb, RFCOMM_SKB_HEAD_RESERVE); |
590 | 590 | ||
591 | err = memcpy_fromiovec(skb_put(skb, size), msg->msg_iov, size); | 591 | err = memcpy_from_msg(skb_put(skb, size), msg, size); |
592 | if (err) { | 592 | if (err) { |
593 | kfree_skb(skb); | 593 | kfree_skb(skb); |
594 | if (sent == 0) | 594 | if (sent == 0) |
diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c index 7ee9e4ab00f8..30e5ea3f1ad3 100644 --- a/net/bluetooth/sco.c +++ b/net/bluetooth/sco.c | |||
@@ -285,7 +285,7 @@ static int sco_send_frame(struct sock *sk, struct msghdr *msg, int len) | |||
285 | if (!skb) | 285 | if (!skb) |
286 | return err; | 286 | return err; |
287 | 287 | ||
288 | if (memcpy_fromiovec(skb_put(skb, len), msg->msg_iov, len)) { | 288 | if (memcpy_from_msg(skb_put(skb, len), msg, len)) { |
289 | kfree_skb(skb); | 289 | kfree_skb(skb); |
290 | return -EFAULT; | 290 | return -EFAULT; |
291 | } | 291 | } |
diff --git a/net/caif/caif_socket.c b/net/caif/caif_socket.c index fbcd156099fb..230f14026c11 100644 --- a/net/caif/caif_socket.c +++ b/net/caif/caif_socket.c | |||
@@ -566,7 +566,7 @@ static int caif_seqpkt_sendmsg(struct kiocb *kiocb, struct socket *sock, | |||
566 | 566 | ||
567 | skb_reserve(skb, cf_sk->headroom); | 567 | skb_reserve(skb, cf_sk->headroom); |
568 | 568 | ||
569 | ret = memcpy_fromiovec(skb_put(skb, len), msg->msg_iov, len); | 569 | ret = memcpy_from_msg(skb_put(skb, len), msg, len); |
570 | 570 | ||
571 | if (ret) | 571 | if (ret) |
572 | goto err; | 572 | goto err; |
@@ -641,7 +641,7 @@ static int caif_stream_sendmsg(struct kiocb *kiocb, struct socket *sock, | |||
641 | */ | 641 | */ |
642 | size = min_t(int, size, skb_tailroom(skb)); | 642 | size = min_t(int, size, skb_tailroom(skb)); |
643 | 643 | ||
644 | err = memcpy_fromiovec(skb_put(skb, size), msg->msg_iov, size); | 644 | err = memcpy_from_msg(skb_put(skb, size), msg, size); |
645 | if (err) { | 645 | if (err) { |
646 | kfree_skb(skb); | 646 | kfree_skb(skb); |
647 | goto out_err; | 647 | goto out_err; |
diff --git a/net/can/bcm.c b/net/can/bcm.c index dcb75c0e66c1..b9a1f715df18 100644 --- a/net/can/bcm.c +++ b/net/can/bcm.c | |||
@@ -858,8 +858,7 @@ static int bcm_tx_setup(struct bcm_msg_head *msg_head, struct msghdr *msg, | |||
858 | 858 | ||
859 | /* update can_frames content */ | 859 | /* update can_frames content */ |
860 | for (i = 0; i < msg_head->nframes; i++) { | 860 | for (i = 0; i < msg_head->nframes; i++) { |
861 | err = memcpy_fromiovec((u8 *)&op->frames[i], | 861 | err = memcpy_from_msg((u8 *)&op->frames[i], msg, CFSIZ); |
862 | msg->msg_iov, CFSIZ); | ||
863 | 862 | ||
864 | if (op->frames[i].can_dlc > 8) | 863 | if (op->frames[i].can_dlc > 8) |
865 | err = -EINVAL; | 864 | err = -EINVAL; |
@@ -894,8 +893,7 @@ static int bcm_tx_setup(struct bcm_msg_head *msg_head, struct msghdr *msg, | |||
894 | op->frames = &op->sframe; | 893 | op->frames = &op->sframe; |
895 | 894 | ||
896 | for (i = 0; i < msg_head->nframes; i++) { | 895 | for (i = 0; i < msg_head->nframes; i++) { |
897 | err = memcpy_fromiovec((u8 *)&op->frames[i], | 896 | err = memcpy_from_msg((u8 *)&op->frames[i], msg, CFSIZ); |
898 | msg->msg_iov, CFSIZ); | ||
899 | 897 | ||
900 | if (op->frames[i].can_dlc > 8) | 898 | if (op->frames[i].can_dlc > 8) |
901 | err = -EINVAL; | 899 | err = -EINVAL; |
@@ -1024,9 +1022,8 @@ static int bcm_rx_setup(struct bcm_msg_head *msg_head, struct msghdr *msg, | |||
1024 | 1022 | ||
1025 | if (msg_head->nframes) { | 1023 | if (msg_head->nframes) { |
1026 | /* update can_frames content */ | 1024 | /* update can_frames content */ |
1027 | err = memcpy_fromiovec((u8 *)op->frames, | 1025 | err = memcpy_from_msg((u8 *)op->frames, msg, |
1028 | msg->msg_iov, | 1026 | msg_head->nframes * CFSIZ); |
1029 | msg_head->nframes * CFSIZ); | ||
1030 | if (err < 0) | 1027 | if (err < 0) |
1031 | return err; | 1028 | return err; |
1032 | 1029 | ||
@@ -1072,8 +1069,8 @@ static int bcm_rx_setup(struct bcm_msg_head *msg_head, struct msghdr *msg, | |||
1072 | } | 1069 | } |
1073 | 1070 | ||
1074 | if (msg_head->nframes) { | 1071 | if (msg_head->nframes) { |
1075 | err = memcpy_fromiovec((u8 *)op->frames, msg->msg_iov, | 1072 | err = memcpy_from_msg((u8 *)op->frames, msg, |
1076 | msg_head->nframes * CFSIZ); | 1073 | msg_head->nframes * CFSIZ); |
1077 | if (err < 0) { | 1074 | if (err < 0) { |
1078 | if (op->frames != &op->sframe) | 1075 | if (op->frames != &op->sframe) |
1079 | kfree(op->frames); | 1076 | kfree(op->frames); |
@@ -1209,7 +1206,7 @@ static int bcm_tx_send(struct msghdr *msg, int ifindex, struct sock *sk) | |||
1209 | 1206 | ||
1210 | can_skb_reserve(skb); | 1207 | can_skb_reserve(skb); |
1211 | 1208 | ||
1212 | err = memcpy_fromiovec(skb_put(skb, CFSIZ), msg->msg_iov, CFSIZ); | 1209 | err = memcpy_from_msg(skb_put(skb, CFSIZ), msg, CFSIZ); |
1213 | if (err < 0) { | 1210 | if (err < 0) { |
1214 | kfree_skb(skb); | 1211 | kfree_skb(skb); |
1215 | return err; | 1212 | return err; |
@@ -1285,7 +1282,7 @@ static int bcm_sendmsg(struct kiocb *iocb, struct socket *sock, | |||
1285 | 1282 | ||
1286 | /* read message head information */ | 1283 | /* read message head information */ |
1287 | 1284 | ||
1288 | ret = memcpy_fromiovec((u8 *)&msg_head, msg->msg_iov, MHSIZ); | 1285 | ret = memcpy_from_msg((u8 *)&msg_head, msg, MHSIZ); |
1289 | if (ret < 0) | 1286 | if (ret < 0) |
1290 | return ret; | 1287 | return ret; |
1291 | 1288 | ||
diff --git a/net/can/raw.c b/net/can/raw.c index 081e81fd017f..0e4004fb6876 100644 --- a/net/can/raw.c +++ b/net/can/raw.c | |||
@@ -703,7 +703,7 @@ static int raw_sendmsg(struct kiocb *iocb, struct socket *sock, | |||
703 | can_skb_reserve(skb); | 703 | can_skb_reserve(skb); |
704 | can_skb_prv(skb)->ifindex = dev->ifindex; | 704 | can_skb_prv(skb)->ifindex = dev->ifindex; |
705 | 705 | ||
706 | err = memcpy_fromiovec(skb_put(skb, size), msg->msg_iov, size); | 706 | err = memcpy_from_msg(skb_put(skb, size), msg, size); |
707 | if (err < 0) | 707 | if (err < 0) |
708 | goto free_skb; | 708 | goto free_skb; |
709 | 709 | ||
diff --git a/net/dccp/proto.c b/net/dccp/proto.c index 8e6ae9422a7b..19f038739087 100644 --- a/net/dccp/proto.c +++ b/net/dccp/proto.c | |||
@@ -781,7 +781,7 @@ int dccp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | |||
781 | goto out_release; | 781 | goto out_release; |
782 | 782 | ||
783 | skb_reserve(skb, sk->sk_prot->max_header); | 783 | skb_reserve(skb, sk->sk_prot->max_header); |
784 | rc = memcpy_fromiovec(skb_put(skb, len), msg->msg_iov, len); | 784 | rc = memcpy_from_msg(skb_put(skb, len), msg, len); |
785 | if (rc != 0) | 785 | if (rc != 0) |
786 | goto out_discard; | 786 | goto out_discard; |
787 | 787 | ||
diff --git a/net/decnet/af_decnet.c b/net/decnet/af_decnet.c index 25733d538147..e2e2e3cb9113 100644 --- a/net/decnet/af_decnet.c +++ b/net/decnet/af_decnet.c | |||
@@ -2032,7 +2032,7 @@ static int dn_sendmsg(struct kiocb *iocb, struct socket *sock, | |||
2032 | 2032 | ||
2033 | skb_reserve(skb, 64 + DN_MAX_NSP_DATA_HEADER); | 2033 | skb_reserve(skb, 64 + DN_MAX_NSP_DATA_HEADER); |
2034 | 2034 | ||
2035 | if (memcpy_fromiovec(skb_put(skb, len), msg->msg_iov, len)) { | 2035 | if (memcpy_from_msg(skb_put(skb, len), msg, len)) { |
2036 | err = -EFAULT; | 2036 | err = -EFAULT; |
2037 | goto out; | 2037 | goto out; |
2038 | } | 2038 | } |
diff --git a/net/ieee802154/dgram.c b/net/ieee802154/dgram.c index b8555ec71387..2c7a93e7167e 100644 --- a/net/ieee802154/dgram.c +++ b/net/ieee802154/dgram.c | |||
@@ -276,7 +276,7 @@ static int dgram_sendmsg(struct kiocb *iocb, struct sock *sk, | |||
276 | if (err < 0) | 276 | if (err < 0) |
277 | goto out_skb; | 277 | goto out_skb; |
278 | 278 | ||
279 | err = memcpy_fromiovec(skb_put(skb, size), msg->msg_iov, size); | 279 | err = memcpy_from_msg(skb_put(skb, size), msg, size); |
280 | if (err < 0) | 280 | if (err < 0) |
281 | goto out_skb; | 281 | goto out_skb; |
282 | 282 | ||
diff --git a/net/ieee802154/raw.c b/net/ieee802154/raw.c index 21c38945ab8b..61e9d2972947 100644 --- a/net/ieee802154/raw.c +++ b/net/ieee802154/raw.c | |||
@@ -150,7 +150,7 @@ static int raw_sendmsg(struct kiocb *iocb, struct sock *sk, | |||
150 | skb_reset_mac_header(skb); | 150 | skb_reset_mac_header(skb); |
151 | skb_reset_network_header(skb); | 151 | skb_reset_network_header(skb); |
152 | 152 | ||
153 | err = memcpy_fromiovec(skb_put(skb, size), msg->msg_iov, size); | 153 | err = memcpy_from_msg(skb_put(skb, size), msg, size); |
154 | if (err < 0) | 154 | if (err < 0) |
155 | goto out_skb; | 155 | goto out_skb; |
156 | 156 | ||
diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c index ce2920f5bef3..ef8f6ee90473 100644 --- a/net/ipv4/ping.c +++ b/net/ipv4/ping.c | |||
@@ -660,7 +660,7 @@ int ping_common_sendmsg(int family, struct msghdr *msg, size_t len, | |||
660 | * Fetch the ICMP header provided by the userland. | 660 | * Fetch the ICMP header provided by the userland. |
661 | * iovec is modified! The ICMP header is consumed. | 661 | * iovec is modified! The ICMP header is consumed. |
662 | */ | 662 | */ |
663 | if (memcpy_fromiovec(user_icmph, msg->msg_iov, icmph_len)) | 663 | if (memcpy_from_msg(user_icmph, msg, icmph_len)) |
664 | return -EFAULT; | 664 | return -EFAULT; |
665 | 665 | ||
666 | if (family == AF_INET) { | 666 | if (family == AF_INET) { |
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index d22a31f27ab4..69de1a1c05c9 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
@@ -4368,7 +4368,7 @@ int tcp_send_rcvq(struct sock *sk, struct msghdr *msg, size_t size) | |||
4368 | if (tcp_try_rmem_schedule(sk, skb, skb->truesize)) | 4368 | if (tcp_try_rmem_schedule(sk, skb, skb->truesize)) |
4369 | goto err_free; | 4369 | goto err_free; |
4370 | 4370 | ||
4371 | if (memcpy_fromiovec(skb_put(skb, size), msg->msg_iov, size)) | 4371 | if (memcpy_from_msg(skb_put(skb, size), msg, size)) |
4372 | goto err_free; | 4372 | goto err_free; |
4373 | 4373 | ||
4374 | TCP_SKB_CB(skb)->seq = tcp_sk(sk)->rcv_nxt; | 4374 | TCP_SKB_CB(skb)->seq = tcp_sk(sk)->rcv_nxt; |
diff --git a/net/irda/af_irda.c b/net/irda/af_irda.c index e8c409055922..9052462cf42a 100644 --- a/net/irda/af_irda.c +++ b/net/irda/af_irda.c | |||
@@ -1319,7 +1319,7 @@ static int irda_sendmsg(struct kiocb *iocb, struct socket *sock, | |||
1319 | skb_reserve(skb, self->max_header_size + 16); | 1319 | skb_reserve(skb, self->max_header_size + 16); |
1320 | skb_reset_transport_header(skb); | 1320 | skb_reset_transport_header(skb); |
1321 | skb_put(skb, len); | 1321 | skb_put(skb, len); |
1322 | err = memcpy_fromiovec(skb_transport_header(skb), msg->msg_iov, len); | 1322 | err = memcpy_from_msg(skb_transport_header(skb), msg, len); |
1323 | if (err) { | 1323 | if (err) { |
1324 | kfree_skb(skb); | 1324 | kfree_skb(skb); |
1325 | goto out_err; | 1325 | goto out_err; |
@@ -1569,7 +1569,7 @@ static int irda_sendmsg_dgram(struct kiocb *iocb, struct socket *sock, | |||
1569 | 1569 | ||
1570 | pr_debug("%s(), appending user data\n", __func__); | 1570 | pr_debug("%s(), appending user data\n", __func__); |
1571 | skb_put(skb, len); | 1571 | skb_put(skb, len); |
1572 | err = memcpy_fromiovec(skb_transport_header(skb), msg->msg_iov, len); | 1572 | err = memcpy_from_msg(skb_transport_header(skb), msg, len); |
1573 | if (err) { | 1573 | if (err) { |
1574 | kfree_skb(skb); | 1574 | kfree_skb(skb); |
1575 | goto out; | 1575 | goto out; |
@@ -1678,7 +1678,7 @@ static int irda_sendmsg_ultra(struct kiocb *iocb, struct socket *sock, | |||
1678 | 1678 | ||
1679 | pr_debug("%s(), appending user data\n", __func__); | 1679 | pr_debug("%s(), appending user data\n", __func__); |
1680 | skb_put(skb, len); | 1680 | skb_put(skb, len); |
1681 | err = memcpy_fromiovec(skb_transport_header(skb), msg->msg_iov, len); | 1681 | err = memcpy_from_msg(skb_transport_header(skb), msg, len); |
1682 | if (err) { | 1682 | if (err) { |
1683 | kfree_skb(skb); | 1683 | kfree_skb(skb); |
1684 | goto out; | 1684 | goto out; |
diff --git a/net/iucv/af_iucv.c b/net/iucv/af_iucv.c index 057b5647ef92..1cd3f8107239 100644 --- a/net/iucv/af_iucv.c +++ b/net/iucv/af_iucv.c | |||
@@ -1122,7 +1122,7 @@ static int iucv_sock_sendmsg(struct kiocb *iocb, struct socket *sock, | |||
1122 | } | 1122 | } |
1123 | if (iucv->transport == AF_IUCV_TRANS_HIPER) | 1123 | if (iucv->transport == AF_IUCV_TRANS_HIPER) |
1124 | skb_reserve(skb, sizeof(struct af_iucv_trans_hdr) + ETH_HLEN); | 1124 | skb_reserve(skb, sizeof(struct af_iucv_trans_hdr) + ETH_HLEN); |
1125 | if (memcpy_fromiovec(skb_put(skb, len), msg->msg_iov, len)) { | 1125 | if (memcpy_from_msg(skb_put(skb, len), msg, len)) { |
1126 | err = -EFAULT; | 1126 | err = -EFAULT; |
1127 | goto fail; | 1127 | goto fail; |
1128 | } | 1128 | } |
diff --git a/net/key/af_key.c b/net/key/af_key.c index e5883091a8c6..f8ac939d52b4 100644 --- a/net/key/af_key.c +++ b/net/key/af_key.c | |||
@@ -3611,7 +3611,7 @@ static int pfkey_sendmsg(struct kiocb *kiocb, | |||
3611 | goto out; | 3611 | goto out; |
3612 | 3612 | ||
3613 | err = -EFAULT; | 3613 | err = -EFAULT; |
3614 | if (memcpy_fromiovec(skb_put(skb,len), msg->msg_iov, len)) | 3614 | if (memcpy_from_msg(skb_put(skb,len), msg, len)) |
3615 | goto out; | 3615 | goto out; |
3616 | 3616 | ||
3617 | hdr = pfkey_get_base_msg(skb, &err); | 3617 | hdr = pfkey_get_base_msg(skb, &err); |
diff --git a/net/l2tp/l2tp_ip.c b/net/l2tp/l2tp_ip.c index a6cc1fed2b52..05dfc8aa36af 100644 --- a/net/l2tp/l2tp_ip.c +++ b/net/l2tp/l2tp_ip.c | |||
@@ -441,7 +441,7 @@ static int l2tp_ip_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *m | |||
441 | *((__be32 *) skb_put(skb, 4)) = 0; | 441 | *((__be32 *) skb_put(skb, 4)) = 0; |
442 | 442 | ||
443 | /* Copy user data into skb */ | 443 | /* Copy user data into skb */ |
444 | rc = memcpy_fromiovec(skb_put(skb, len), msg->msg_iov, len); | 444 | rc = memcpy_from_msg(skb_put(skb, len), msg, len); |
445 | if (rc < 0) { | 445 | if (rc < 0) { |
446 | kfree_skb(skb); | 446 | kfree_skb(skb); |
447 | goto error; | 447 | goto error; |
diff --git a/net/l2tp/l2tp_ppp.c b/net/l2tp/l2tp_ppp.c index c559bcdf4679..cc7a828fc914 100644 --- a/net/l2tp/l2tp_ppp.c +++ b/net/l2tp/l2tp_ppp.c | |||
@@ -346,8 +346,7 @@ static int pppol2tp_sendmsg(struct kiocb *iocb, struct socket *sock, struct msgh | |||
346 | skb_put(skb, 2); | 346 | skb_put(skb, 2); |
347 | 347 | ||
348 | /* Copy user data into skb */ | 348 | /* Copy user data into skb */ |
349 | error = memcpy_fromiovec(skb_put(skb, total_len), m->msg_iov, | 349 | error = memcpy_from_msg(skb_put(skb, total_len), m, total_len); |
350 | total_len); | ||
351 | if (error < 0) { | 350 | if (error < 0) { |
352 | kfree_skb(skb); | 351 | kfree_skb(skb); |
353 | goto error_put_sess_tun; | 352 | goto error_put_sess_tun; |
diff --git a/net/llc/af_llc.c b/net/llc/af_llc.c index af662669f951..2c0b83ce43bd 100644 --- a/net/llc/af_llc.c +++ b/net/llc/af_llc.c | |||
@@ -921,7 +921,7 @@ static int llc_ui_sendmsg(struct kiocb *iocb, struct socket *sock, | |||
921 | skb->dev = llc->dev; | 921 | skb->dev = llc->dev; |
922 | skb->protocol = llc_proto_type(addr->sllc_arphrd); | 922 | skb->protocol = llc_proto_type(addr->sllc_arphrd); |
923 | skb_reserve(skb, hdrlen); | 923 | skb_reserve(skb, hdrlen); |
924 | rc = memcpy_fromiovec(skb_put(skb, copied), msg->msg_iov, copied); | 924 | rc = memcpy_from_msg(skb_put(skb, copied), msg, copied); |
925 | if (rc) | 925 | if (rc) |
926 | goto out; | 926 | goto out; |
927 | if (sk->sk_type == SOCK_DGRAM || addr->sllc_ua) { | 927 | if (sk->sk_type == SOCK_DGRAM || addr->sllc_ua) { |
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index e1aad6eeac14..63aa5c8acf12 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c | |||
@@ -2325,7 +2325,7 @@ static int netlink_sendmsg(struct kiocb *kiocb, struct socket *sock, | |||
2325 | NETLINK_CB(skb).flags = netlink_skb_flags; | 2325 | NETLINK_CB(skb).flags = netlink_skb_flags; |
2326 | 2326 | ||
2327 | err = -EFAULT; | 2327 | err = -EFAULT; |
2328 | if (memcpy_fromiovec(skb_put(skb, len), msg->msg_iov, len)) { | 2328 | if (memcpy_from_msg(skb_put(skb, len), msg, len)) { |
2329 | kfree_skb(skb); | 2329 | kfree_skb(skb); |
2330 | goto out; | 2330 | goto out; |
2331 | } | 2331 | } |
diff --git a/net/netrom/af_netrom.c b/net/netrom/af_netrom.c index 7e13f6afcd1f..69f1d5e9959f 100644 --- a/net/netrom/af_netrom.c +++ b/net/netrom/af_netrom.c | |||
@@ -1113,7 +1113,7 @@ static int nr_sendmsg(struct kiocb *iocb, struct socket *sock, | |||
1113 | skb_put(skb, len); | 1113 | skb_put(skb, len); |
1114 | 1114 | ||
1115 | /* User data follows immediately after the NET/ROM transport header */ | 1115 | /* User data follows immediately after the NET/ROM transport header */ |
1116 | if (memcpy_fromiovec(skb_transport_header(skb), msg->msg_iov, len)) { | 1116 | if (memcpy_from_msg(skb_transport_header(skb), msg, len)) { |
1117 | kfree_skb(skb); | 1117 | kfree_skb(skb); |
1118 | err = -EFAULT; | 1118 | err = -EFAULT; |
1119 | goto out; | 1119 | goto out; |
diff --git a/net/nfc/llcp_commands.c b/net/nfc/llcp_commands.c index a3ad69a4c648..c4da0c2d8a14 100644 --- a/net/nfc/llcp_commands.c +++ b/net/nfc/llcp_commands.c | |||
@@ -665,7 +665,7 @@ int nfc_llcp_send_i_frame(struct nfc_llcp_sock *sock, | |||
665 | if (msg_data == NULL) | 665 | if (msg_data == NULL) |
666 | return -ENOMEM; | 666 | return -ENOMEM; |
667 | 667 | ||
668 | if (memcpy_fromiovec(msg_data, msg->msg_iov, len)) { | 668 | if (memcpy_from_msg(msg_data, msg, len)) { |
669 | kfree(msg_data); | 669 | kfree(msg_data); |
670 | return -EFAULT; | 670 | return -EFAULT; |
671 | } | 671 | } |
@@ -731,7 +731,7 @@ int nfc_llcp_send_ui_frame(struct nfc_llcp_sock *sock, u8 ssap, u8 dsap, | |||
731 | if (msg_data == NULL) | 731 | if (msg_data == NULL) |
732 | return -ENOMEM; | 732 | return -ENOMEM; |
733 | 733 | ||
734 | if (memcpy_fromiovec(msg_data, msg->msg_iov, len)) { | 734 | if (memcpy_from_msg(msg_data, msg, len)) { |
735 | kfree(msg_data); | 735 | kfree(msg_data); |
736 | return -EFAULT; | 736 | return -EFAULT; |
737 | } | 737 | } |
diff --git a/net/nfc/rawsock.c b/net/nfc/rawsock.c index 9d7d2b7ba5e4..373e138c0ab6 100644 --- a/net/nfc/rawsock.c +++ b/net/nfc/rawsock.c | |||
@@ -231,7 +231,7 @@ static int rawsock_sendmsg(struct kiocb *iocb, struct socket *sock, | |||
231 | if (skb == NULL) | 231 | if (skb == NULL) |
232 | return rc; | 232 | return rc; |
233 | 233 | ||
234 | rc = memcpy_fromiovec(skb_put(skb, len), msg->msg_iov, len); | 234 | rc = memcpy_from_msg(skb_put(skb, len), msg, len); |
235 | if (rc < 0) { | 235 | if (rc < 0) { |
236 | kfree_skb(skb); | 236 | kfree_skb(skb); |
237 | return rc; | 237 | return rc; |
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index 58af58026dd2..07ac95014ecb 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c | |||
@@ -1676,7 +1676,7 @@ retry: | |||
1676 | if (len < hhlen) | 1676 | if (len < hhlen) |
1677 | skb_reset_network_header(skb); | 1677 | skb_reset_network_header(skb); |
1678 | } | 1678 | } |
1679 | err = memcpy_fromiovec(skb_put(skb, len), msg->msg_iov, len); | 1679 | err = memcpy_from_msg(skb_put(skb, len), msg, len); |
1680 | if (err) | 1680 | if (err) |
1681 | goto out_free; | 1681 | goto out_free; |
1682 | goto retry; | 1682 | goto retry; |
@@ -2446,8 +2446,7 @@ static int packet_snd(struct socket *sock, struct msghdr *msg, size_t len) | |||
2446 | 2446 | ||
2447 | len -= vnet_hdr_len; | 2447 | len -= vnet_hdr_len; |
2448 | 2448 | ||
2449 | err = memcpy_fromiovec((void *)&vnet_hdr, msg->msg_iov, | 2449 | err = memcpy_from_msg((void *)&vnet_hdr, msg, vnet_hdr_len); |
2450 | vnet_hdr_len); | ||
2451 | if (err < 0) | 2450 | if (err < 0) |
2452 | goto out_unlock; | 2451 | goto out_unlock; |
2453 | 2452 | ||
diff --git a/net/phonet/datagram.c b/net/phonet/datagram.c index 0918bc21eae6..26054b4b467c 100644 --- a/net/phonet/datagram.c +++ b/net/phonet/datagram.c | |||
@@ -109,7 +109,7 @@ static int pn_sendmsg(struct kiocb *iocb, struct sock *sk, | |||
109 | return err; | 109 | return err; |
110 | skb_reserve(skb, MAX_PHONET_HEADER); | 110 | skb_reserve(skb, MAX_PHONET_HEADER); |
111 | 111 | ||
112 | err = memcpy_fromiovec((void *)skb_put(skb, len), msg->msg_iov, len); | 112 | err = memcpy_from_msg((void *)skb_put(skb, len), msg, len); |
113 | if (err < 0) { | 113 | if (err < 0) { |
114 | kfree_skb(skb); | 114 | kfree_skb(skb); |
115 | return err; | 115 | return err; |
diff --git a/net/phonet/pep.c b/net/phonet/pep.c index 9cd069dfaf65..5d3f2b7507d4 100644 --- a/net/phonet/pep.c +++ b/net/phonet/pep.c | |||
@@ -1141,7 +1141,7 @@ static int pep_sendmsg(struct kiocb *iocb, struct sock *sk, | |||
1141 | return err; | 1141 | return err; |
1142 | 1142 | ||
1143 | skb_reserve(skb, MAX_PHONET_HEADER + 3 + pn->aligned); | 1143 | skb_reserve(skb, MAX_PHONET_HEADER + 3 + pn->aligned); |
1144 | err = memcpy_fromiovec(skb_put(skb, len), msg->msg_iov, len); | 1144 | err = memcpy_from_msg(skb_put(skb, len), msg, len); |
1145 | if (err < 0) | 1145 | if (err < 0) |
1146 | goto outfree; | 1146 | goto outfree; |
1147 | 1147 | ||
diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c index 9b600c20a7a3..43bac7c4dd9e 100644 --- a/net/rose/af_rose.c +++ b/net/rose/af_rose.c | |||
@@ -1121,7 +1121,7 @@ static int rose_sendmsg(struct kiocb *iocb, struct socket *sock, | |||
1121 | skb_reset_transport_header(skb); | 1121 | skb_reset_transport_header(skb); |
1122 | skb_put(skb, len); | 1122 | skb_put(skb, len); |
1123 | 1123 | ||
1124 | err = memcpy_fromiovec(skb_transport_header(skb), msg->msg_iov, len); | 1124 | err = memcpy_from_msg(skb_transport_header(skb), msg, len); |
1125 | if (err) { | 1125 | if (err) { |
1126 | kfree_skb(skb); | 1126 | kfree_skb(skb); |
1127 | return err; | 1127 | return err; |
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c index 9f32741abb1c..e49bccebb0cc 100644 --- a/net/sctp/sm_make_chunk.c +++ b/net/sctp/sm_make_chunk.c | |||
@@ -1001,7 +1001,7 @@ no_mem: | |||
1001 | 1001 | ||
1002 | /* Helper to create ABORT with a SCTP_ERROR_USER_ABORT error. */ | 1002 | /* Helper to create ABORT with a SCTP_ERROR_USER_ABORT error. */ |
1003 | struct sctp_chunk *sctp_make_abort_user(const struct sctp_association *asoc, | 1003 | struct sctp_chunk *sctp_make_abort_user(const struct sctp_association *asoc, |
1004 | const struct msghdr *msg, | 1004 | struct msghdr *msg, |
1005 | size_t paylen) | 1005 | size_t paylen) |
1006 | { | 1006 | { |
1007 | struct sctp_chunk *retval; | 1007 | struct sctp_chunk *retval; |
@@ -1018,7 +1018,7 @@ struct sctp_chunk *sctp_make_abort_user(const struct sctp_association *asoc, | |||
1018 | if (!payload) | 1018 | if (!payload) |
1019 | goto err_payload; | 1019 | goto err_payload; |
1020 | 1020 | ||
1021 | err = memcpy_fromiovec(payload, msg->msg_iov, paylen); | 1021 | err = memcpy_from_msg(payload, msg, paylen); |
1022 | if (err < 0) | 1022 | if (err < 0) |
1023 | goto err_copy; | 1023 | goto err_copy; |
1024 | } | 1024 | } |
diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c index 59e785bfde65..d9149b68b9bc 100644 --- a/net/x25/af_x25.c +++ b/net/x25/af_x25.c | |||
@@ -1170,7 +1170,7 @@ static int x25_sendmsg(struct kiocb *iocb, struct socket *sock, | |||
1170 | skb_reset_transport_header(skb); | 1170 | skb_reset_transport_header(skb); |
1171 | skb_put(skb, len); | 1171 | skb_put(skb, len); |
1172 | 1172 | ||
1173 | rc = memcpy_fromiovec(skb_transport_header(skb), msg->msg_iov, len); | 1173 | rc = memcpy_from_msg(skb_transport_header(skb), msg, len); |
1174 | if (rc) | 1174 | if (rc) |
1175 | goto out_kfree_skb; | 1175 | goto out_kfree_skb; |
1176 | 1176 | ||