Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F147539842
D14621.1783703263.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
858 B
Referenced Files
None
Subscribers
None
D14621.1783703263.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
Fri, Jul 10, 5:07 PM (18 h, 24 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29062314
Default Alt Text
D14621.1783703263.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