Skip to contentSkip to conversation

ipv4: make ip_append_data() handle NULL routing table

PATCH New Julien TINNES 1 participant 1 message Aug 27, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---

net/ipv4/ip_output.c +2 -0
diff -r b3cbf0ceeb34 net/ipv4/ip_output.c
@@ -814,6 +814,8 @@
 			inet->cork.addr = ipc->addr;
 		}
 		rt = *rtp;
+		if (unlikely(!rt))
+			return -EFAULT;
 		/*
 		 * We steal reference to this route, caller should not release it
 		 */