aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien TINNES <julien@cr0.org>2009-08-27 09:26:58 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-08-27 15:23:43 -0400
commit788d908f2879a17e5f80924f3da2e23f1034482d (patch)
tree890ada4f22e9ce5d64a121efc1ca63390d6b2100
parent9886e836a6a5dbd273dc55b17e713f0a188d137f (diff)
ipv4: make ip_append_data() handle NULL routing table
Add a check in ip_append_data() for NULL *rtp to prevent future bugs in callers from being exploitable. Signed-off-by: Julien Tinnes <julien@cr0.org> Signed-off-by: Tavis Ormandy <taviso@sdf.lonestar.org> Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--net/ipv4/ip_output.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index 7d0821054729..7ffcd96fe591 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -813,6 +813,8 @@ int ip_append_data(struct sock *sk,
813 inet->cork.addr = ipc->addr; 813 inet->cork.addr = ipc->addr;
814 } 814 }
815 rt = *rtp; 815 rt = *rtp;
816 if (unlikely(!rt))
817 return -EFAULT;
816 /* 818 /*
817 * We steal reference to this route, caller should not release it 819 * We steal reference to this route, caller should not release it
818 */ 820 */