Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 788d908f authored by Julien TINNES's avatar Julien TINNES Committed by Linus Torvalds
Browse files

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: default avatarJulien Tinnes <julien@cr0.org>
Signed-off-by: default avatarTavis Ormandy <taviso@sdf.lonestar.org>
Acked-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 9886e836
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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
		 */