Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F145319340
D14621.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
858 B
Referenced Files
None
Subscribers
None
D14621.diff
View Options
Index: head/sys/netinet/ip_output.c
===================================================================
--- head/sys/netinet/ip_output.c
+++ head/sys/netinet/ip_output.c
@@ -1256,13 +1256,23 @@
switch (sopt->sopt_name) {
case IP_OPTIONS:
case IP_RETOPTS:
- if (inp->inp_options)
- error = sooptcopyout(sopt,
- mtod(inp->inp_options,
- char *),
- inp->inp_options->m_len);
- else
+ INP_RLOCK(inp);
+ if (inp->inp_options) {
+ struct mbuf *options;
+
+ options = m_dup(inp->inp_options, M_NOWAIT);
+ INP_RUNLOCK(inp);
+ if (options != NULL) {
+ error = sooptcopyout(sopt,
+ mtod(options, char *),
+ options->m_len);
+ m_freem(options);
+ } else
+ error = ENOMEM;
+ } else {
+ INP_RUNLOCK(inp);
sopt->sopt_valsize = 0;
+ }
break;
case IP_TOS:
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Feb 19, 8:55 AM (1 h, 45 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28874594
Default Alt Text
D14621.diff (858 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