tcp/dccp: fix potential NULL deref in __inet_inherit_port()
[deliverable/linux.git] / net / ipv4 / inet_hashtables.c
index 08643a3616af70fd3f3ba4ce0d41e258d9f259d9..958728a22001bb514cf47b5a421690062131bcba 100644 (file)
@@ -137,6 +137,10 @@ int __inet_inherit_port(const struct sock *sk, struct sock *child)
 
        spin_lock(&head->lock);
        tb = inet_csk(sk)->icsk_bind_hash;
+       if (unlikely(!tb)) {
+               spin_unlock(&head->lock);
+               return -ENOENT;
+       }
        if (tb->port != port) {
                /* NOTE: using tproxy and redirecting skbs to a proxy
                 * on a different listener port breaks the assumption
This page took 0.02372 seconds and 5 git commands to generate.