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

    ipv4: avoid passing NULL to inet_putpeer() in icmpv4_xrlim_allow()

to the 3.6-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:
     ipv4-avoid-passing-null-to-inet_putpeer-in-icmpv4_xrlim_allow.patch
and it can be found in the queue-3.6 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.


>From 788229f19d20bd6644a2ebca359ecd54e4ce1b1a Mon Sep 17 00:00:00 2001
From: Neal Cardwell <[email protected]>
Date: Sat, 24 Nov 2012 18:54:37 +0000
Subject: ipv4: avoid passing NULL to inet_putpeer() in icmpv4_xrlim_allow()


From: Neal Cardwell <[email protected]>

[ Upstream commit e1a676424c290b1c8d757e3860170ac7ecd89af4 ]

inet_getpeer_v4() can return NULL under OOM conditions, and while
inet_peer_xrlim_allow() is OK with a NULL peer, inet_putpeer() will
crash.

This code path now uses the same idiom as the others from:
1d861aa4b3fb08822055345f480850205ffe6170 ("inet: Minimize use of
cached route inetpeer.").

Signed-off-by: Neal Cardwell <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
 net/ipv4/icmp.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/net/ipv4/icmp.c
+++ b/net/ipv4/icmp.c
@@ -257,7 +257,8 @@ static inline bool icmpv4_xrlim_allow(st
                struct inet_peer *peer = inet_getpeer_v4(net->ipv4.peers, 
fl4->daddr, 1);
                rc = inet_peer_xrlim_allow(peer,
                                           net->ipv4.sysctl_icmp_ratelimit);
-               inet_putpeer(peer);
+               if (peer)
+                       inet_putpeer(peer);
        }
 out:
        return rc;


Patches currently in stable-queue which might be from [email protected] are

queue-3.6/inet_diag-validate-byte-code-to-prevent-oops-in-inet_diag_bc_run.patch
queue-3.6/ipv4-avoid-passing-null-to-inet_putpeer-in-icmpv4_xrlim_allow.patch
queue-3.6/inet_diag-validate-port-comparison-byte-code-to-prevent-unsafe-reads.patch
queue-3.6/inet_diag-avoid-unsafe-and-nonsensical-prefix-matches-in-inet_diag_bc_run.patch
queue-3.6/inet_diag-fix-oops-for-ipv4-af_inet6-tcp-syn-recv-state.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to