From: Julien TINNES Date: Thu, 27 Aug 2009 13:26:58 +0000 (+0200) Subject: ipv4: make ip_append_data() handle NULL routing table X-Git-Tag: v4.14-rc1~22380 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=788d908f2879a17e5f80924f3da2e23f1034482d;p=platform%2Fkernel%2Flinux-rpi.git 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 Signed-off-by: Tavis Ormandy Acked-by: David S. Miller Signed-off-by: Linus Torvalds --- 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, inet->cork.addr = ipc->addr; } rt = *rtp; + if (unlikely(!rt)) + return -EFAULT; /* * We steal reference to this route, caller should not release it */