Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F150520564
D31890.id94924.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
758 B
Referenced Files
None
Subscribers
None
D31890.id94924.diff
View Options
Index: sys/netipsec/ipsec_input.c
===================================================================
--- sys/netipsec/ipsec_input.c
+++ 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, Apr 2, 11:31 PM (9 h, 19 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30738867
Default Alt Text
D31890.id94924.diff (758 B)
Attached To
Mode
D31890: ipsec: Validate the protocol identifier in ipsec4_ctlinput()
Attached
Detach File
Event Timeline
Log In to Comment