[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20150622125833.451c4440@canb.auug.org.au>
Date: Mon, 22 Jun 2015 12:58:33 +1000
From: Stephen Rothwell <sfr@...b.auug.org.au>
To: David Miller <davem@...emloft.net>, <netdev@...r.kernel.org>
Cc: linux-next@...r.kernel.org, linux-kernel@...r.kernel.org,
Willem de Bruijn <willemb@...gle.com>
Subject: linux-next: manual merge of the net-next tree with the net tree
Hi all,
Today's linux-next merge of the net-next tree got a conflict in:
net/packet/af_packet.c
between commit:
468479e6043c ("packet: avoid out of bounds read in round robin fanout")
from the net tree and commit:
3b3a5b0aab5b ("packet: rollover huge flows before small flows")
from the net-next tree.
I fixed it up (see below) and can carry the fix as necessary (no action
is required).
--
Cheers,
Stephen Rothwell sfr@...b.auug.org.au
diff --cc net/packet/af_packet.c
index fe1610ddeacf,20e8c40da90d..000000000000
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@@ -1272,6 -1326,30 +1326,20 @@@ static void packet_sock_destruct(struc
sk_refcnt_debug_dec(sk);
}
-static int fanout_rr_next(struct packet_fanout *f, unsigned int num)
-{
- int x = atomic_read(&f->rr_cur) + 1;
-
- if (x >= num)
- x = 0;
-
- return x;
-}
-
+ static bool fanout_flow_is_huge(struct packet_sock *po, struct sk_buff *skb)
+ {
+ u32 rxhash;
+ int i, count = 0;
+
+ rxhash = skb_get_hash(skb);
+ for (i = 0; i < ROLLOVER_HLEN; i++)
+ if (po->rollover->history[i] == rxhash)
+ count++;
+
+ po->rollover->history[prandom_u32() % ROLLOVER_HLEN] = rxhash;
+ return count > (ROLLOVER_HLEN >> 1);
+ }
+
static unsigned int fanout_demux_hash(struct packet_fanout *f,
struct sk_buff *skb,
unsigned int num)
Content of type "application/pgp-signature" skipped
Powered by blists - more mailing lists