Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F145423586
D14621.id45285.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
800 B
Referenced Files
None
Subscribers
None
D14621.id45285.diff
View Options
Index: head/sys/netinet/ip_output.c
===================================================================
--- head/sys/netinet/ip_output.c
+++ head/sys/netinet/ip_output.c
@@ -1256,12 +1256,18 @@
switch (sopt->sopt_name) {
case IP_OPTIONS:
case IP_RETOPTS:
- if (inp->inp_options)
+ if (inp->inp_options) {
+ unsigned long len = ulmin(inp->inp_options->m_len, sopt->sopt_valsize);
+ struct mbuf *options = malloc(len, M_TEMP, M_WAITOK);
+ INP_RLOCK(inp);
+ bcopy(inp->inp_options, options, len);
+ INP_RUNLOCK(inp);
error = sooptcopyout(sopt,
- mtod(inp->inp_options,
+ mtod(options,
char *),
- inp->inp_options->m_len);
- else
+ len);
+ free(options, M_TEMP);
+ } else
sopt->sopt_valsize = 0;
break;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Feb 20, 4:27 PM (7 h, 23 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28901445
Default Alt Text
D14621.id45285.diff (800 B)
Attached To
Mode
D14621: Fix a potential use after free in getsockopt() access to inp_options
Attached
Detach File
Event Timeline
Log In to Comment