summaryrefslogtreecommitdiffstats
path: root/drivers/net/xen-netfront.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-10-05 11:50:15 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2019-10-05 11:50:15 -0400
commit9819a30c11ea439e5e3c81f5539c4d42d6c76314 (patch)
treeeee29b4735a2ddb944260ad3d281efd4a56788cc /drivers/net/xen-netfront.c
parent6fe137cbe3e85e832a169006e8ccc04cec69c653 (diff)
parentef129d34149ea23d0d442844fc25ae26a85589fc (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from David Miller: 1) Fix ieeeu02154 atusb driver use-after-free, from Johan Hovold. 2) Need to validate TCA_CBQ_WRROPT netlink attributes, from Eric Dumazet. 3) txq null deref in mac80211, from Miaoqing Pan. 4) ionic driver needs to select NET_DEVLINK, from Arnd Bergmann. 5) Need to disable bh during nft_connlimit GC, from Pablo Neira Ayuso. 6) Avoid division by zero in taprio scheduler, from Vladimir Oltean. 7) Various xgmac fixes in stmmac driver from Jose Abreu. 8) Avoid 64-bit division in mlx5 leading to link errors on 32-bit from Michal Kubecek. 9) Fix bad VLAN check in rtl8366 DSA driver, from Linus Walleij. 10) Fix sleep while atomic in sja1105, from Vladimir Oltean. 11) Suspend/resume deadlock in stmmac, from Thierry Reding. 12) Various UDP GSO fixes from Josh Hunt. 13) Fix slab out of bounds access in tcp_zerocopy_receive(), from Eric Dumazet. 14) Fix OOPS in __ipv6_ifa_notify(), from David Ahern. 15) Memory leak in NFC's llcp_sock_bind, from Eric Dumazet. * git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (72 commits) selftests/net: add nettest to .gitignore net: qlogic: Fix memory leak in ql_alloc_large_buffers nfc: fix memory leak in llcp_sock_bind() sch_dsmark: fix potential NULL deref in dsmark_init() net: phy: at803x: use operating parameters from PHY-specific status net: phy: extract pause mode net: phy: extract link partner advertisement reading net: phy: fix write to mii-ctrl1000 register ipv6: Handle missing host route in __ipv6_ifa_notify net: phy: allow for reset line to be tied to a sleepy GPIO controller net: ipv4: avoid mixed n_redirects and rate_tokens usage r8152: Set macpassthru in reset_resume callback cxgb4:Fix out-of-bounds MSI-X info array access Revert "ipv6: Handle race in addrconf_dad_work" net: make sock_prot_memory_pressure() return "const char *" rxrpc: Fix rxrpc_recvmsg tracepoint qmi_wwan: add support for Cinterion CLS8 devices tcp: fix slab-out-of-bounds in tcp_zerocopy_receive() lib: textsearch: fix escapes in example code udp: only do GSO if # of segs > 1 ...
Diffstat (limited to 'drivers/net/xen-netfront.c')
-rw-r--r--drivers/net/xen-netfront.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index e14ec75b61d6..482c6c8b0fb7 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -887,9 +887,9 @@ static int xennet_set_skb_gso(struct sk_buff *skb,
887 return 0; 887 return 0;
888} 888}
889 889
890static RING_IDX xennet_fill_frags(struct netfront_queue *queue, 890static int xennet_fill_frags(struct netfront_queue *queue,
891 struct sk_buff *skb, 891 struct sk_buff *skb,
892 struct sk_buff_head *list) 892 struct sk_buff_head *list)
893{ 893{
894 RING_IDX cons = queue->rx.rsp_cons; 894 RING_IDX cons = queue->rx.rsp_cons;
895 struct sk_buff *nskb; 895 struct sk_buff *nskb;
@@ -908,7 +908,7 @@ static RING_IDX xennet_fill_frags(struct netfront_queue *queue,
908 if (unlikely(skb_shinfo(skb)->nr_frags >= MAX_SKB_FRAGS)) { 908 if (unlikely(skb_shinfo(skb)->nr_frags >= MAX_SKB_FRAGS)) {
909 queue->rx.rsp_cons = ++cons + skb_queue_len(list); 909 queue->rx.rsp_cons = ++cons + skb_queue_len(list);
910 kfree_skb(nskb); 910 kfree_skb(nskb);
911 return ~0U; 911 return -ENOENT;
912 } 912 }
913 913
914 skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags, 914 skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags,
@@ -919,7 +919,9 @@ static RING_IDX xennet_fill_frags(struct netfront_queue *queue,
919 kfree_skb(nskb); 919 kfree_skb(nskb);
920 } 920 }
921 921
922 return cons; 922 queue->rx.rsp_cons = cons;
923
924 return 0;
923} 925}
924 926
925static int checksum_setup(struct net_device *dev, struct sk_buff *skb) 927static int checksum_setup(struct net_device *dev, struct sk_buff *skb)
@@ -1045,8 +1047,7 @@ err:
1045 skb->data_len = rx->status; 1047 skb->data_len = rx->status;
1046 skb->len += rx->status; 1048 skb->len += rx->status;
1047 1049
1048 i = xennet_fill_frags(queue, skb, &tmpq); 1050 if (unlikely(xennet_fill_frags(queue, skb, &tmpq)))
1049 if (unlikely(i == ~0U))
1050 goto err; 1051 goto err;
1051 1052
1052 if (rx->flags & XEN_NETRXF_csum_blank) 1053 if (rx->flags & XEN_NETRXF_csum_blank)
@@ -1056,7 +1057,7 @@ err:
1056 1057
1057 __skb_queue_tail(&rxq, skb); 1058 __skb_queue_tail(&rxq, skb);
1058 1059
1059 queue->rx.rsp_cons = ++i; 1060 i = ++queue->rx.rsp_cons;
1060 work_done++; 1061 work_done++;
1061 } 1062 }
1062 1063