aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-12-16 13:24:44 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2016-12-16 13:24:44 -0500
commit9a19a6db37ee0b7a6db796b3dcd6bb6e7237d6ea (patch)
tree614d68498eea1c6f9120cae07806f916fd9776bc /net
parentbd9999cd6a5eb899504ce14c1f70c5479143bbbc (diff)
parentc4364f837caf618c2fdb51a2e132cf29dfd1fffa (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs updates from Al Viro: - more ->d_init() stuff (work.dcache) - pathname resolution cleanups (work.namei) - a few missing iov_iter primitives - copy_from_iter_full() and friends. Either copy the full requested amount, advance the iterator and return true, or fail, return false and do _not_ advance the iterator. Quite a few open-coded callers converted (and became more readable and harder to fuck up that way) (work.iov_iter) - several assorted patches, the big one being logfs removal * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: logfs: remove from tree vfs: fix put_compat_statfs64() does not handle errors namei: fold should_follow_link() with the step into not-followed link namei: pass both WALK_GET and WALK_MORE to should_follow_link() namei: invert WALK_PUT logics namei: shift interpretation of LOOKUP_FOLLOW inside should_follow_link() namei: saner calling conventions for mountpoint_last() namei.c: get rid of user_path_parent() switch getfrag callbacks to ..._full() primitives make skb_add_data,{_nocache}() and skb_copy_to_page_nocache() advance only on success [iov_iter] new primitives - copy_from_iter_full() and friends don't open-code file_inode() ceph: switch to use of ->d_init() ceph: unify dentry_operations instances lustre: switch to use of ->d_init()
Diffstat (limited to 'net')
-rw-r--r--net/atm/common.c2
-rw-r--r--net/bluetooth/l2cap_core.c6
-rw-r--r--net/ipv4/ip_output.c4
-rw-r--r--net/ipv4/ping.c8
-rw-r--r--net/packet/af_packet.c5
-rw-r--r--net/tipc/msg.c4
6 files changed, 13 insertions, 16 deletions
diff --git a/net/atm/common.c b/net/atm/common.c
index 6dc12305799e..a3ca922d307b 100644
--- a/net/atm/common.c
+++ b/net/atm/common.c
@@ -630,7 +630,7 @@ int vcc_sendmsg(struct socket *sock, struct msghdr *m, size_t size)
630 goto out; 630 goto out;
631 skb->dev = NULL; /* for paths shared with net_device interfaces */ 631 skb->dev = NULL; /* for paths shared with net_device interfaces */
632 ATM_SKB(skb)->atm_options = vcc->atm_options; 632 ATM_SKB(skb)->atm_options = vcc->atm_options;
633 if (copy_from_iter(skb_put(skb, size), size, &m->msg_iter) != size) { 633 if (!copy_from_iter_full(skb_put(skb, size), size, &m->msg_iter)) {
634 kfree_skb(skb); 634 kfree_skb(skb);
635 error = -EFAULT; 635 error = -EFAULT;
636 goto out; 636 goto out;
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index 577f1c01454a..ce0b5dd01953 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -2127,7 +2127,7 @@ static inline int l2cap_skbuff_fromiovec(struct l2cap_chan *chan,
2127 struct sk_buff **frag; 2127 struct sk_buff **frag;
2128 int sent = 0; 2128 int sent = 0;
2129 2129
2130 if (copy_from_iter(skb_put(skb, count), count, &msg->msg_iter) != count) 2130 if (!copy_from_iter_full(skb_put(skb, count), count, &msg->msg_iter))
2131 return -EFAULT; 2131 return -EFAULT;
2132 2132
2133 sent += count; 2133 sent += count;
@@ -2147,8 +2147,8 @@ static inline int l2cap_skbuff_fromiovec(struct l2cap_chan *chan,
2147 2147
2148 *frag = tmp; 2148 *frag = tmp;
2149 2149
2150 if (copy_from_iter(skb_put(*frag, count), count, 2150 if (!copy_from_iter_full(skb_put(*frag, count), count,
2151 &msg->msg_iter) != count) 2151 &msg->msg_iter))
2152 return -EFAULT; 2152 return -EFAULT;
2153 2153
2154 sent += count; 2154 sent += count;
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index 9ffc2625cddd..6c9615c90f37 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -826,11 +826,11 @@ ip_generic_getfrag(void *from, char *to, int offset, int len, int odd, struct sk
826 struct msghdr *msg = from; 826 struct msghdr *msg = from;
827 827
828 if (skb->ip_summed == CHECKSUM_PARTIAL) { 828 if (skb->ip_summed == CHECKSUM_PARTIAL) {
829 if (copy_from_iter(to, len, &msg->msg_iter) != len) 829 if (!copy_from_iter_full(to, len, &msg->msg_iter))
830 return -EFAULT; 830 return -EFAULT;
831 } else { 831 } else {
832 __wsum csum = 0; 832 __wsum csum = 0;
833 if (csum_and_copy_from_iter(to, len, &csum, &msg->msg_iter) != len) 833 if (!csum_and_copy_from_iter_full(to, len, &csum, &msg->msg_iter))
834 return -EFAULT; 834 return -EFAULT;
835 skb->csum = csum_block_add(skb->csum, csum, odd); 835 skb->csum = csum_block_add(skb->csum, csum, odd);
836 } 836 }
diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c
index 5b2635e69a92..86cca610f4c2 100644
--- a/net/ipv4/ping.c
+++ b/net/ipv4/ping.c
@@ -609,15 +609,15 @@ int ping_getfrag(void *from, char *to,
609 fraglen -= sizeof(struct icmphdr); 609 fraglen -= sizeof(struct icmphdr);
610 if (fraglen < 0) 610 if (fraglen < 0)
611 BUG(); 611 BUG();
612 if (csum_and_copy_from_iter(to + sizeof(struct icmphdr), 612 if (!csum_and_copy_from_iter_full(to + sizeof(struct icmphdr),
613 fraglen, &pfh->wcheck, 613 fraglen, &pfh->wcheck,
614 &pfh->msg->msg_iter) != fraglen) 614 &pfh->msg->msg_iter))
615 return -EFAULT; 615 return -EFAULT;
616 } else if (offset < sizeof(struct icmphdr)) { 616 } else if (offset < sizeof(struct icmphdr)) {
617 BUG(); 617 BUG();
618 } else { 618 } else {
619 if (csum_and_copy_from_iter(to, fraglen, &pfh->wcheck, 619 if (!csum_and_copy_from_iter_full(to, fraglen, &pfh->wcheck,
620 &pfh->msg->msg_iter) != fraglen) 620 &pfh->msg->msg_iter))
621 return -EFAULT; 621 return -EFAULT;
622 } 622 }
623 623
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index 89f2e8c1f4dc..49cd0c70a13a 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -2397,14 +2397,11 @@ static int __packet_snd_vnet_parse(struct virtio_net_hdr *vnet_hdr, size_t len)
2397static int packet_snd_vnet_parse(struct msghdr *msg, size_t *len, 2397static int packet_snd_vnet_parse(struct msghdr *msg, size_t *len,
2398 struct virtio_net_hdr *vnet_hdr) 2398 struct virtio_net_hdr *vnet_hdr)
2399{ 2399{
2400 int n;
2401
2402 if (*len < sizeof(*vnet_hdr)) 2400 if (*len < sizeof(*vnet_hdr))
2403 return -EINVAL; 2401 return -EINVAL;
2404 *len -= sizeof(*vnet_hdr); 2402 *len -= sizeof(*vnet_hdr);
2405 2403
2406 n = copy_from_iter(vnet_hdr, sizeof(*vnet_hdr), &msg->msg_iter); 2404 if (!copy_from_iter_full(vnet_hdr, sizeof(*vnet_hdr), &msg->msg_iter))
2407 if (n != sizeof(*vnet_hdr))
2408 return -EFAULT; 2405 return -EFAULT;
2409 2406
2410 return __packet_snd_vnet_parse(vnet_hdr, *len); 2407 return __packet_snd_vnet_parse(vnet_hdr, *len);
diff --git a/net/tipc/msg.c b/net/tipc/msg.c
index 17201aa8423d..a22be502f1bd 100644
--- a/net/tipc/msg.c
+++ b/net/tipc/msg.c
@@ -268,7 +268,7 @@ int tipc_msg_build(struct tipc_msg *mhdr, struct msghdr *m,
268 __skb_queue_tail(list, skb); 268 __skb_queue_tail(list, skb);
269 skb_copy_to_linear_data(skb, mhdr, mhsz); 269 skb_copy_to_linear_data(skb, mhdr, mhsz);
270 pktpos = skb->data + mhsz; 270 pktpos = skb->data + mhsz;
271 if (copy_from_iter(pktpos, dsz, &m->msg_iter) == dsz) 271 if (copy_from_iter_full(pktpos, dsz, &m->msg_iter))
272 return dsz; 272 return dsz;
273 rc = -EFAULT; 273 rc = -EFAULT;
274 goto error; 274 goto error;
@@ -299,7 +299,7 @@ int tipc_msg_build(struct tipc_msg *mhdr, struct msghdr *m,
299 if (drem < pktrem) 299 if (drem < pktrem)
300 pktrem = drem; 300 pktrem = drem;
301 301
302 if (copy_from_iter(pktpos, pktrem, &m->msg_iter) != pktrem) { 302 if (!copy_from_iter_full(pktpos, pktrem, &m->msg_iter)) {
303 rc = -EFAULT; 303 rc = -EFAULT;
304 goto error; 304 goto error;
305 } 305 }