diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-08-06 21:06:02 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-08-06 21:06:02 -0700 |
commit | 6456a0438b984186a0c9c8ecc9fe3d97b7ac3613 (patch) | |
tree | 51e61c1c269cd3647b73d6cf5d2168167f9fb0a6 /net/ipv6 | |
parent | 158c12948f3012fbe15f066f308db23502d3db0a (diff) | |
parent | 6c8f7e70837468da4e658080d4448930fb597e1b (diff) | |
download | op-kernel-dev-6456a0438b984186a0c9c8ecc9fe3d97b7ac3613.zip op-kernel-dev-6456a0438b984186a0c9c8ecc9fe3d97b7ac3613.tar.gz |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller:
"This fixes the most immediate fallout from yesterday's networking
merge:
1) sock_tx_timestamp() must not clear the passed in tx_flags, but
rather add to them. Fix from Eric Dumazet.
2) The hyperv driver sendbuf region increase needs to be decreased
slightly to handle older backends. From KY Srinivasan.
3) Fix RCU lockdep splats in netlink diag after recent hashing
changes, from Thomas Graf.
4) The new IPV6_FLOWLABEL was given a socket option number that
overlapped with an existing IP6 tables one, breaking ip6_tables.
Fixed by Pablo Neira Ayuso"
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net:
netlink: hold nl_sock_hash_lock during diag dump
tcp: md5: check md5 signature without socket lock
net: fix USB network driver config option.
net: reallocate new socket option number for IPV6_AUTOFLOWLABEL
vmxnet3: fix decimal printf format specifiers prefixed with 0x
net-timestamp: cumulative tcp timestamping fixes
hyperv: Adjust the size of sendbuf region to support ws2008r2
cxgb4: Fix for SR-IOV VF initialization
net-timestamp: sock_tx_timestamp() fix
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/tcp_ipv6.c | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 22055b0..f2ce955 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c @@ -667,7 +667,8 @@ clear_hash_noput: return 1; } -static int tcp_v6_inbound_md5_hash(struct sock *sk, const struct sk_buff *skb) +static int __tcp_v6_inbound_md5_hash(struct sock *sk, + const struct sk_buff *skb) { const __u8 *hash_location = NULL; struct tcp_md5sig_key *hash_expected; @@ -707,6 +708,18 @@ static int tcp_v6_inbound_md5_hash(struct sock *sk, const struct sk_buff *skb) } return 0; } + +static int tcp_v6_inbound_md5_hash(struct sock *sk, const struct sk_buff *skb) +{ + int ret; + + rcu_read_lock(); + ret = __tcp_v6_inbound_md5_hash(sk, skb); + rcu_read_unlock(); + + return ret; +} + #endif static void tcp_v6_init_req(struct request_sock *req, struct sock *sk, @@ -1247,11 +1260,6 @@ static int tcp_v6_do_rcv(struct sock *sk, struct sk_buff *skb) if (skb->protocol == htons(ETH_P_IP)) return tcp_v4_do_rcv(sk, skb); -#ifdef CONFIG_TCP_MD5SIG - if (tcp_v6_inbound_md5_hash(sk, skb)) - goto discard; -#endif - if (sk_filter(sk, skb)) goto discard; @@ -1424,6 +1432,11 @@ process: if (!xfrm6_policy_check(sk, XFRM_POLICY_IN, skb)) goto discard_and_relse; +#ifdef CONFIG_TCP_MD5SIG + if (tcp_v6_inbound_md5_hash(sk, skb)) + goto discard_and_relse; +#endif + if (sk_filter(sk, skb)) goto discard_and_relse; |