]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
[PATCH] TCP: Do not use inet->id of global tcp_socket when sending RST (CVE-2006...
authorAlexey Kuznetsov <kuznet@ms2.inr.ac.ru>
Wed, 22 Mar 2006 22:34:42 +0000 (14:34 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 28 Mar 2006 06:47:30 +0000 (22:47 -0800)
The problem is in ip_push_pending_frames(), which uses:

        if (!df) {
                __ip_select_ident(iph, &rt->u.dst, 0);
        } else {
                iph->id = htons(inet->id++);
        }

instead of ip_select_ident().

Right now I think the code is a nonsense. Most likely, I copied it from
old ip_build_xmit(), where it was really special, we had to decide
whether to generate unique ID when generating the first (well, the last)
fragment.

In ip_push_pending_frames() it does not make sense, it should use plain
ip_select_ident() instead.

Signed-off-by: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
net/ipv4/ip_output.c

index 8ee4d016740d925f3781b8fc7842c99ed2145c27..f75ff1d96551d1e03cbfba7153c1bedb9b6e36df 100644 (file)
@@ -1249,11 +1249,7 @@ int ip_push_pending_frames(struct sock *sk)
        iph->tos = inet->tos;
        iph->tot_len = htons(skb->len);
        iph->frag_off = df;
-       if (!df) {
-               __ip_select_ident(iph, &rt->u.dst, 0);
-       } else {
-               iph->id = htons(inet->id++);
-       }
+       ip_select_ident(iph, &rt->u.dst, sk);
        iph->ttl = ttl;
        iph->protocol = sk->sk_protocol;
        iph->saddr = rt->rt_src;