FreeBSD Bugzilla – Attachment 13567 Details for
Bug 25751
Patch against crash caused by operations with half-binded sockets.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 1.78 KB, created by
Unicorn
on 2001-03-12 21:20:01 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Unicorn
Created:
2001-03-12 21:20:01 UTC
Size:
1.78 KB
patch
obsolete
>Index: in_pcb.c >=================================================================== >RCS file: /home/ncvs/src/sys/netinet/in_pcb.c,v >retrieving revision 1.81 >diff -u -r1.81 in_pcb.c >--- in_pcb.c 2001/03/04 21:28:40 1.81 >+++ in_pcb.c 2001/03/12 10:39:56 >@@ -272,8 +272,15 @@ > int count; > > if (inp->inp_laddr.s_addr != INADDR_ANY) >- if (prison_ip(p->p_ucred, 0, &inp->inp_laddr.s_addr )) >+ if (prison_ip(p->p_ucred, 0, &inp->inp_laddr.s_addr )) { >+ /* >+ * Undo any address bind that may have >+ * occurred above. >+ */ >+ inp->inp_laddr.s_addr = INADDR_ANY; >+ > return (EINVAL); >+ } > inp->inp_flags |= INP_ANONPORT; > > if (inp->inp_flags & INP_HIGHPORT) { >@@ -281,8 +288,14 @@ > last = ipport_hilastauto; > lastport = &pcbinfo->lasthi; > } else if (inp->inp_flags & INP_LOWPORT) { >- if (p && (error = suser_xxx(0, p, PRISON_ROOT))) >+ if (p && (error = suser_xxx(0, p, PRISON_ROOT))) { >+ /* >+ * Undo any address bind that may have >+ * occurred above. >+ */ >+ inp->inp_laddr.s_addr = INADDR_ANY; > return error; >+ } > first = ipport_lowfirstauto; /* 1023 */ > last = ipport_lowlastauto; /* 600 */ > lastport = &pcbinfo->lastlow; >@@ -306,10 +319,6 @@ > > do { > if (count-- < 0) { /* completely used? */ >- /* >- * Undo any address bind that may have >- * occurred above. >- */ > inp->inp_laddr.s_addr = INADDR_ANY; > return (EADDRNOTAVAIL); > } >@@ -343,8 +352,13 @@ > } > } > inp->inp_lport = lport; >- if (prison_ip(p->p_ucred, 0, &inp->inp_laddr.s_addr)) >- return(EINVAL); >+ >+ if (prison_ip(p->p_ucred, 0, &inp->inp_laddr.s_addr)) { >+ inp->inp_laddr.s_addr = INADDR_ANY; >+ inp->inp_lport = 0; >+ return (EINVAL); >+ } >+ > if (in_pcbinshash(inp) != 0) { > inp->inp_laddr.s_addr = INADDR_ANY; > inp->inp_lport = 0;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 25751
: 13567