aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-04-22 01:37:27 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-04-22 01:37:27 -0400
commit8aaa51b63cc3c5f3b2e72d2f0e193d9c2e00fe46 (patch)
tree25d068f3d666791cc1c44ad4c2afe03b24059f53 /net
parentf614c8178b0696d070b23f36a2a27b5128f6c372 (diff)
parentfab9adfb71fc8690e20c3c280d39d49c8f4a3f0a (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: "Just a few fixes trickling in at this point. 1) If we see an attached socket on an skb in the ipv4 forwarding path, bail. This can happen due to races with FIB rule addition, and deletion, and we should just drop such frames. From Sebastian Pöhn. 2) pppoe receive should only accept packets destined for this hosts's MAC address. From Joakim Tjernlund. 3) Handle checksum unwrapping properly in ppp receive properly when it's encapsulated in UDP in some way, fix from Tom Herbert. 4) Fix some bugs in mv88e6xxx DSA driver resulting from the conversion from register offset constants to mnenomic macros. From Vivien Didelot. 5) Fix handling of HCA max message size in mlx4 adapters, from Eran Ben ELisha" * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: net/mlx4_core: Fix reading HCA max message size in mlx4_QUERY_DEV_CAP tcp: add memory barriers to write space paths altera tse: Error-Bit on tx-avalon-stream always set. net: dsa: mv88e6xxx: use PORT_DEFAULT_VLAN net: dsa: mv88e6xxx: fix setup of port control 1 ppp: call skb_checksum_complete_unset in ppp_receive_frame net: add skb_checksum_complete_unset pppoe: Lacks DST MAC address check ip_forward: Drop frames with attached skb->sk
Diffstat (limited to 'net')
-rw-r--r--net/ipv4/ip_forward.c3
-rw-r--r--net/ipv4/tcp.c4
-rw-r--r--net/ipv4/tcp_input.c2
3 files changed, 8 insertions, 1 deletions
diff --git a/net/ipv4/ip_forward.c b/net/ipv4/ip_forward.c
index 939992c456f3..3674484946a5 100644
--- a/net/ipv4/ip_forward.c
+++ b/net/ipv4/ip_forward.c
@@ -82,6 +82,9 @@ int ip_forward(struct sk_buff *skb)
82 if (skb->pkt_type != PACKET_HOST) 82 if (skb->pkt_type != PACKET_HOST)
83 goto drop; 83 goto drop;
84 84
85 if (unlikely(skb->sk))
86 goto drop;
87
85 if (skb_warn_if_lro(skb)) 88 if (skb_warn_if_lro(skb))
86 goto drop; 89 goto drop;
87 90
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 59c8a027721b..8c5cd9efebbc 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -520,8 +520,10 @@ unsigned int tcp_poll(struct file *file, struct socket *sock, poll_table *wait)
520 520
521 /* Race breaker. If space is freed after 521 /* Race breaker. If space is freed after
522 * wspace test but before the flags are set, 522 * wspace test but before the flags are set,
523 * IO signal will be lost. 523 * IO signal will be lost. Memory barrier
524 * pairs with the input side.
524 */ 525 */
526 smp_mb__after_atomic();
525 if (sk_stream_is_writeable(sk)) 527 if (sk_stream_is_writeable(sk))
526 mask |= POLLOUT | POLLWRNORM; 528 mask |= POLLOUT | POLLWRNORM;
527 } 529 }
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index a7ef679dd3ea..3a4d9b34bed4 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -4845,6 +4845,8 @@ static void tcp_check_space(struct sock *sk)
4845{ 4845{
4846 if (sock_flag(sk, SOCK_QUEUE_SHRUNK)) { 4846 if (sock_flag(sk, SOCK_QUEUE_SHRUNK)) {
4847 sock_reset_flag(sk, SOCK_QUEUE_SHRUNK); 4847 sock_reset_flag(sk, SOCK_QUEUE_SHRUNK);
4848 /* pairs with tcp_poll() */
4849 smp_mb__after_atomic();
4848 if (sk->sk_socket && 4850 if (sk->sk_socket &&
4849 test_bit(SOCK_NOSPACE, &sk->sk_socket->flags)) 4851 test_bit(SOCK_NOSPACE, &sk->sk_socket->flags))
4850 tcp_new_space(sk); 4852 tcp_new_space(sk);