Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F160387163
D31890.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
730 B
Referenced Files
None
Subscribers
None
D31890.diff
View Options
diff --git a/sys/netipsec/ipsec_input.c b/sys/netipsec/ipsec_input.c
--- a/sys/netipsec/ipsec_input.c
+++ b/sys/netipsec/ipsec_input.c
@@ -276,6 +276,7 @@
struct icmp *icp;
struct ip *ip = v;
uint32_t pmtu, spi;
+ uint8_t proto;
if (code != PRC_MSGSIZE || ip == NULL)
return (EINVAL);
@@ -289,8 +290,13 @@
if (pmtu < V_ip4_ipsec_min_pmtu)
return (EINVAL);
+ proto = ip->ip_p;
+ if (proto != IPPROTO_ESP && proto != IPPROTO_AH &&
+ proto != IPPROTO_IPCOMP)
+ return (EINVAL);
+
memcpy(&spi, (caddr_t)ip + (ip->ip_hl << 2), sizeof(spi));
- sav = key_allocsa((union sockaddr_union *)sa, ip->ip_p, spi);
+ sav = key_allocsa((union sockaddr_union *)sa, proto, spi);
if (sav == NULL)
return (ENOENT);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jun 25, 12:25 AM (15 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
34297014
Default Alt Text
D31890.diff (730 B)
Attached To
Mode
D31890: ipsec: Validate the protocol identifier in ipsec4_ctlinput()
Attached
Detach File
Event Timeline
Log In to Comment