Patch "udp: ipv4: do not waste time in" has been added to the 3.14-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    udp: ipv4: do not waste time in

to the 3.14-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     udp-ipv4-do-not-waste-time-in.patch
and it can be found in the queue-3.14 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.


>From foo@baz Thu Jun 19 10:28:46 PDT 2014
From: Eric Dumazet <edumazet@xxxxxxxxxx>
Date: Thu, 12 Jun 2014 16:13:06 -0700
Subject: udp: ipv4: do not waste time in
 __udp4_lib_mcast_demux_lookup

From: Eric Dumazet <edumazet@xxxxxxxxxx>

[ Upstream commit 63c6f81cdde58c41da62a8d8a209592e42a0203e ]

Its too easy to add thousand of UDP sockets on a particular bucket,
and slow down an innocent multicast receiver.

Early demux is supposed to be an optimization, we should avoid spending
too much time in it.

It is interesting to note __udp4_lib_demux_lookup() only tries to
match first socket in the chain.

10 is the threshold we already have in __udp4_lib_lookup() to switch
to secondary hash.

Fixes: 421b3885bf6d5 ("udp: ipv4: Add udp early demux")
Signed-off-by: Eric Dumazet <edumazet@xxxxxxxxxx>
Reported-by: David Held <drheld@xxxxxxxxxx>
Cc: Shawn Bohrer <sbohrer@xxxxxxxxxxxxxxx>
Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 net/ipv4/udp.c |    4 ++++
 1 file changed, 4 insertions(+)

--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -1833,6 +1833,10 @@ static struct sock *__udp4_lib_mcast_dem
 	unsigned int count, slot = udp_hashfn(net, hnum, udp_table.mask);
 	struct udp_hslot *hslot = &udp_table.hash[slot];
 
+	/* Do not bother scanning a too big list */
+	if (hslot->count > 10)
+		return NULL;
+
 	rcu_read_lock();
 begin:
 	count = 0;


Patches currently in stable-queue which might be from edumazet@xxxxxxxxxx are

queue-3.14/net-fix-inet_getid-and-ipv6_select_ident-bugs.patch
queue-3.14/ipv6-fix-regression-caused-by-efe4208-in.patch
queue-3.14/net-force-a-list_del-in-unregister_netdevice_many.patch
queue-3.14/udp-ipv4-do-not-waste-time-in.patch
queue-3.14/ipv4-fix-a-race-in-ip4_datagram_release_cb.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]