Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F147838747
D38936.id118435.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D38936.id118435.diff
View Options
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c
--- a/sys/netinet/tcp_subr.c
+++ b/sys/netinet/tcp_subr.c
@@ -2759,10 +2759,14 @@
}
ip = &icp->icmp_ip;
+ if (ip->ip_src.s_addr == INADDR_ANY ||
+ ip->ip_dst.s_addr == INADDR_ANY)
+ return;
+
th = (struct tcphdr *)((caddr_t)ip + (ip->ip_hl << 2));
+ inp = in_pcblookup(&V_tcbinfo, ip->ip_dst, th->th_dport,
+ ip->ip_src, th->th_sport, INPLOOKUP_WLOCKPCB, NULL);
icmp_tcp_seq = th->th_seq;
- inp = in_pcblookup(&V_tcbinfo, ip->ip_dst, th->th_dport, ip->ip_src,
- th->th_sport, INPLOOKUP_WLOCKPCB, NULL);
if (inp != NULL) {
tp = intotcpcb(inp);
#ifdef TCP_OFFLOAD
@@ -2943,6 +2947,10 @@
(int32_t) (off + sizeof(struct tcp_ports)))) {
return;
}
+ if (IN6_IS_ADDR_UNSPECIFIED(&ip6->ip6_src) ||
+ IN6_IS_ADDR_UNSPECIFIED(&ip6->ip6_dst))
+ return;
+
bzero(&t_ports, sizeof(struct tcp_ports));
m_copydata(m, off, sizeof(struct tcp_ports), (caddr_t)&t_ports);
inp = in6_pcblookup(&V_tcbinfo, &ip6->ip6_dst, t_ports.th_dport,
diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c
--- a/sys/netinet/udp_usrreq.c
+++ b/sys/netinet/udp_usrreq.c
@@ -710,6 +710,8 @@
if (icmp_errmap(icmp) == 0)
return;
+ if (ip->ip_src.s_addr == INADDR_ANY || ip->ip_dst.s_addr == INADDR_ANY)
+ return;
uh = (struct udphdr *)((caddr_t)ip + (ip->ip_hl << 2));
inp = in_pcblookup(pcbinfo, ip->ip_dst, uh->uh_dport, ip->ip_src,
diff --git a/sys/netinet6/udp6_usrreq.c b/sys/netinet6/udp6_usrreq.c
--- a/sys/netinet6/udp6_usrreq.c
+++ b/sys/netinet6/udp6_usrreq.c
@@ -562,6 +562,9 @@
/* Check if we can safely examine src and dst ports. */
if (m->m_pkthdr.len < off + sizeof(*uhp))
return;
+ if (IN6_IS_ADDR_UNSPECIFIED(&ip6->ip6_src) ||
+ IN6_IS_ADDR_UNSPECIFIED(&ip6->ip6_dst))
+ return;
bzero(&uh, sizeof(uh));
m_copydata(m, off, sizeof(*uhp), (caddr_t)&uh);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Mar 15, 2:04 AM (5 h, 21 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29697155
Default Alt Text
D38936.id118435.diff (1 KB)
Attached To
Mode
D38936: netinet: Disallow unspecified addresses in ICMP-embedded packets
Attached
Detach File
Event Timeline
Log In to Comment