Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F141141796
D14621.id40605.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
967 B
Referenced Files
None
Subscribers
None
D14621.id40605.diff
View Options
Index: sys/netinet/ip_output.c
===================================================================
--- sys/netinet/ip_output.c
+++ sys/netinet/ip_output.c
@@ -956,6 +956,7 @@
ip_ctloutput(struct socket *so, struct sockopt *sopt)
{
struct inpcb *inp = sotoinpcb(so);
+ struct mbuf *options;
int error, optval;
#ifdef RSS
uint32_t rss_bucket;
@@ -1242,12 +1243,18 @@
switch (sopt->sopt_name) {
case IP_OPTIONS:
case IP_RETOPTS:
- if (inp->inp_options)
+ if (inp->inp_options) {
+ unsinged long len = ulmin(inp->inp_options->m_len, sopt->sopt_valsize);
+ 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, Jan 2, 10:38 AM (5 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27455383
Default Alt Text
D14621.id40605.diff (967 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