Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net:
netfilter: xt_connbytes: handle negation correctly
net: relax rcvbuf limits
rps: fix insufficient bounds checking in store_rps_dev_flow_table_cnt()
net: introduce DST_NOPEER dst flag
mqprio: Avoid panic if no options are provided
bridge: provide a mtu() method for fake_dst_ops

+26 -20
+1
include/net/dst.h
··· 53 53 #define DST_NOHASH 0x0008 54 54 #define DST_NOCACHE 0x0010 55 55 #define DST_NOCOUNT 0x0020 56 + #define DST_NOPEER 0x0040 56 57 57 58 short error; 58 59 short obsolete;
+3 -1
include/net/sock.h
··· 637 637 638 638 /* 639 639 * Take into account size of receive queue and backlog queue 640 + * Do not take into account this skb truesize, 641 + * to allow even a single big packet to come. 640 642 */ 641 643 static inline bool sk_rcvqueues_full(const struct sock *sk, const struct sk_buff *skb) 642 644 { 643 645 unsigned int qsize = sk->sk_backlog.len + atomic_read(&sk->sk_rmem_alloc); 644 646 645 - return qsize + skb->truesize > sk->sk_rcvbuf; 647 + return qsize > sk->sk_rcvbuf; 646 648 } 647 649 648 650 /* The per-socket spinlock must be held here. */
+7 -1
net/bridge/br_netfilter.c
··· 114 114 return NULL; 115 115 } 116 116 117 + static unsigned int fake_mtu(const struct dst_entry *dst) 118 + { 119 + return dst->dev->mtu; 120 + } 121 + 117 122 static struct dst_ops fake_dst_ops = { 118 123 .family = AF_INET, 119 124 .protocol = cpu_to_be16(ETH_P_IP), 120 125 .update_pmtu = fake_update_pmtu, 121 126 .cow_metrics = fake_cow_metrics, 122 127 .neigh_lookup = fake_neigh_lookup, 128 + .mtu = fake_mtu, 123 129 }; 124 130 125 131 /* ··· 147 141 rt->dst.dev = br->dev; 148 142 rt->dst.path = &rt->dst; 149 143 dst_init_metrics(&rt->dst, br_dst_default_metrics, true); 150 - rt->dst.flags = DST_NOXFRM; 144 + rt->dst.flags = DST_NOXFRM | DST_NOPEER; 151 145 rt->dst.ops = &fake_dst_ops; 152 146 } 153 147
+5 -2
net/core/net-sysfs.c
··· 665 665 if (count) { 666 666 int i; 667 667 668 - if (count > 1<<30) { 668 + if (count > INT_MAX) 669 + return -EINVAL; 670 + count = roundup_pow_of_two(count); 671 + if (count > (ULONG_MAX - sizeof(struct rps_dev_flow_table)) 672 + / sizeof(struct rps_dev_flow)) { 669 673 /* Enforce a limit to prevent overflow */ 670 674 return -EINVAL; 671 675 } 672 - count = roundup_pow_of_two(count); 673 676 table = vmalloc(RPS_DEV_FLOW_TABLE_SIZE(count)); 674 677 if (!table) 675 678 return -ENOMEM;
+1 -5
net/core/sock.c
··· 288 288 unsigned long flags; 289 289 struct sk_buff_head *list = &sk->sk_receive_queue; 290 290 291 - /* Cast sk->rcvbuf to unsigned... It's pointless, but reduces 292 - number of warnings when compiling with -W --ANK 293 - */ 294 - if (atomic_read(&sk->sk_rmem_alloc) + skb->truesize >= 295 - (unsigned)sk->sk_rcvbuf) { 291 + if (atomic_read(&sk->sk_rmem_alloc) >= sk->sk_rcvbuf) { 296 292 atomic_inc(&sk->sk_drops); 297 293 trace_sock_rcvqueue_full(sk, skb); 298 294 return -ENOMEM;
+2 -2
net/ipv4/route.c
··· 1367 1367 { 1368 1368 struct rtable *rt = (struct rtable *) dst; 1369 1369 1370 - if (rt) { 1370 + if (rt && !(rt->dst.flags & DST_NOPEER)) { 1371 1371 if (rt->peer == NULL) 1372 1372 rt_bind_peer(rt, rt->rt_dst, 1); 1373 1373 ··· 1378 1378 iph->id = htons(inet_getid(rt->peer, more)); 1379 1379 return; 1380 1380 } 1381 - } else 1381 + } else if (!rt) 1382 1382 printk(KERN_DEBUG "rt_bind_peer(0) @%p\n", 1383 1383 __builtin_return_address(0)); 1384 1384
+1 -1
net/ipv6/ip6_output.c
··· 603 603 static atomic_t ipv6_fragmentation_id; 604 604 int old, new; 605 605 606 - if (rt) { 606 + if (rt && !(rt->dst.flags & DST_NOPEER)) { 607 607 struct inet_peer *peer; 608 608 609 609 if (!rt->rt6i_peer)
+3 -3
net/netfilter/xt_connbytes.c
··· 87 87 break; 88 88 } 89 89 90 - if (sinfo->count.to) 90 + if (sinfo->count.to >= sinfo->count.from) 91 91 return what <= sinfo->count.to && what >= sinfo->count.from; 92 - else 93 - return what >= sinfo->count.from; 92 + else /* inverted */ 93 + return what < sinfo->count.to || what > sinfo->count.from; 94 94 } 95 95 96 96 static int connbytes_mt_check(const struct xt_mtchk_param *par)
+2 -4
net/packet/af_packet.c
··· 1630 1630 if (snaplen > res) 1631 1631 snaplen = res; 1632 1632 1633 - if (atomic_read(&sk->sk_rmem_alloc) + skb->truesize >= 1634 - (unsigned)sk->sk_rcvbuf) 1633 + if (atomic_read(&sk->sk_rmem_alloc) >= sk->sk_rcvbuf) 1635 1634 goto drop_n_acct; 1636 1635 1637 1636 if (skb_shared(skb)) { ··· 1761 1762 if (po->tp_version <= TPACKET_V2) { 1762 1763 if (macoff + snaplen > po->rx_ring.frame_size) { 1763 1764 if (po->copy_thresh && 1764 - atomic_read(&sk->sk_rmem_alloc) + skb->truesize 1765 - < (unsigned)sk->sk_rcvbuf) { 1765 + atomic_read(&sk->sk_rmem_alloc) < sk->sk_rcvbuf) { 1766 1766 if (skb_shared(skb)) { 1767 1767 copy_skb = skb_clone(skb, GFP_ATOMIC); 1768 1768 } else {
+1 -1
net/sched/sch_mqprio.c
··· 107 107 if (!netif_is_multiqueue(dev)) 108 108 return -EOPNOTSUPP; 109 109 110 - if (nla_len(opt) < sizeof(*qopt)) 110 + if (!opt || nla_len(opt) < sizeof(*qopt)) 111 111 return -EINVAL; 112 112 113 113 qopt = nla_data(opt);