Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F159592317
D14621.id45317.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
843 B
Referenced Files
None
Subscribers
None
D14621.id45317.diff
View Options
Index: sys/netinet/ip_output.c
===================================================================
--- sys/netinet/ip_output.c
+++ sys/netinet/ip_output.c
@@ -1242,13 +1242,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
Wed, Jun 17, 1:01 AM (51 m, 36 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
34008142
Default Alt Text
D14621.id45317.diff (843 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