public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/13763] New: bindresvport() function is multithread-unsafe
@ 2012-02-27 8:53 penght at cn dot fujitsu.com
2012-05-09 6:59 ` [Bug libc/13763] " penght at cn dot fujitsu.com
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: penght at cn dot fujitsu.com @ 2012-02-27 8:53 UTC (permalink / raw)
To: glibc-bugs
http://sourceware.org/bugzilla/show_bug.cgi?id=13763
Bug #: 13763
Summary: bindresvport() function is multithread-unsafe
Product: glibc
Version: unspecified
Status: NEW
Severity: normal
Priority: P2
Component: libc
AssignedTo: unassigned@sourceware.org
ReportedBy: penght@cn.fujitsu.com
CC: drepper.fsp@gmail.com
Classification: Unclassified
Created attachment 6250
--> http://sourceware.org/bugzilla/attachment.cgi?id=6250
The Patch can make bindresvport() function to multithread-safe
bindresvport() uses two static variables port and startport which are not
protected. It is not safe when in multithread circumstance.
bindresvport() select a port number from the range 512 to 1023, when in
multithread circumstance, the port may be 1024. So the static variables will be
protected.
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug libc/13763] bindresvport() function is multithread-unsafe
2012-02-27 8:53 [Bug libc/13763] New: bindresvport() function is multithread-unsafe penght at cn dot fujitsu.com
@ 2012-05-09 6:59 ` penght at cn dot fujitsu.com
2012-09-19 2:03 ` penght at cn dot fujitsu.com
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: penght at cn dot fujitsu.com @ 2012-05-09 6:59 UTC (permalink / raw)
To: glibc-bugs
http://sourceware.org/bugzilla/show_bug.cgi?id=13763
--- Comment #1 from Peng Haitao <penght at cn dot fujitsu.com> 2012-05-09 06:59:28 UTC ---
Created attachment 6403
--> http://sourceware.org/bugzilla/attachment.cgi?id=6403
The program can testify bindresvport() is multithread-unsafe
Steps to Reproduce:
# gcc -o bindresvport -lpthread bindresvport.c
# while true; do ./bindresvport 2>&1 | grep 1024; if [ $? -eq 0 ]; then break;
fi; done
port = 1024
The program output the bound port, valid value is 512 to 1023. if the bound
port is 1024, bindresvport() is multithread-unsafe.
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug libc/13763] bindresvport() function is multithread-unsafe
2012-02-27 8:53 [Bug libc/13763] New: bindresvport() function is multithread-unsafe penght at cn dot fujitsu.com
2012-05-09 6:59 ` [Bug libc/13763] " penght at cn dot fujitsu.com
@ 2012-09-19 2:03 ` penght at cn dot fujitsu.com
2012-09-19 2:06 ` penght at cn dot fujitsu.com
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: penght at cn dot fujitsu.com @ 2012-09-19 2:03 UTC (permalink / raw)
To: glibc-bugs
http://sourceware.org/bugzilla/show_bug.cgi?id=13763
Peng Haitao <penght at cn dot fujitsu.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #6250|0 |1
is obsolete| |
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug libc/13763] bindresvport() function is multithread-unsafe
2012-02-27 8:53 [Bug libc/13763] New: bindresvport() function is multithread-unsafe penght at cn dot fujitsu.com
2012-05-09 6:59 ` [Bug libc/13763] " penght at cn dot fujitsu.com
2012-09-19 2:03 ` penght at cn dot fujitsu.com
@ 2012-09-19 2:06 ` penght at cn dot fujitsu.com
2012-10-31 15:07 ` carlos_odonell at mentor dot com
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: penght at cn dot fujitsu.com @ 2012-09-19 2:06 UTC (permalink / raw)
To: glibc-bugs
http://sourceware.org/bugzilla/show_bug.cgi?id=13763
--- Comment #2 from Peng Haitao <penght at cn dot fujitsu.com> 2012-09-19 02:05:50 UTC ---
Created attachment 6637
--> http://sourceware.org/bugzilla/attachment.cgi?id=6637
The Patch can make bindresvport() function to multithread-safe.
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug libc/13763] bindresvport() function is multithread-unsafe
2012-02-27 8:53 [Bug libc/13763] New: bindresvport() function is multithread-unsafe penght at cn dot fujitsu.com
` (2 preceding siblings ...)
2012-09-19 2:06 ` penght at cn dot fujitsu.com
@ 2012-10-31 15:07 ` carlos_odonell at mentor dot com
2012-11-19 6:58 ` carlos_odonell at mentor dot com
2014-06-26 14:22 ` fweimer at redhat dot com
5 siblings, 0 replies; 7+ messages in thread
From: carlos_odonell at mentor dot com @ 2012-10-31 15:07 UTC (permalink / raw)
To: glibc-bugs
http://sourceware.org/bugzilla/show_bug.cgi?id=13763
Carlos O'Donell <carlos_odonell at mentor dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
CC| |carlos_odonell at mentor
| |dot com
AssignedTo|unassigned at sourceware |carlos_odonell at mentor
|dot org |dot com
--- Comment #3 from Carlos O'Donell <carlos_odonell at mentor dot com> 2012-10-31 15:07:14 UTC ---
I'm working to get v2 (using locks) checked in.
I see that the patch required is already attached to this issue which is good.
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug libc/13763] bindresvport() function is multithread-unsafe
2012-02-27 8:53 [Bug libc/13763] New: bindresvport() function is multithread-unsafe penght at cn dot fujitsu.com
` (3 preceding siblings ...)
2012-10-31 15:07 ` carlos_odonell at mentor dot com
@ 2012-11-19 6:58 ` carlos_odonell at mentor dot com
2014-06-26 14:22 ` fweimer at redhat dot com
5 siblings, 0 replies; 7+ messages in thread
From: carlos_odonell at mentor dot com @ 2012-11-19 6:58 UTC (permalink / raw)
To: glibc-bugs
http://sourceware.org/bugzilla/show_bug.cgi?id=13763
Carlos O'Donell <carlos_odonell at mentor dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
Target Milestone|--- |2.17
--- Comment #4 from Carlos O'Donell <carlos_odonell at mentor dot com> 2012-11-19 06:57:41 UTC ---
commit f6da27e53695ad1cc0e2a9490358decbbfdff5e5
Author: Peng Haitao <penght@cn.fujitsu.com>
Date: Mon Nov 19 01:53:07 2012 -0500
bindresvport() uses two static variables port and startport which are not
protected. It is not safe when in multithread circumstance.
bindresvport() select a port number from the range 512 to 1023, when in
multithread circumstance, the port may be 1024. So the static variables
will be
protected.
Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>
Reviewed-by: Carlos O'Donell <carlos@systemhalted.org>
---
2012-11-19 Peng Haitao <penght@cn.fujitsu.com>
[BZ #13763]
* sunrpc/bindrsvprt.c: Add lock to protect static variable.
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug libc/13763] bindresvport() function is multithread-unsafe
2012-02-27 8:53 [Bug libc/13763] New: bindresvport() function is multithread-unsafe penght at cn dot fujitsu.com
` (4 preceding siblings ...)
2012-11-19 6:58 ` carlos_odonell at mentor dot com
@ 2014-06-26 14:22 ` fweimer at redhat dot com
5 siblings, 0 replies; 7+ messages in thread
From: fweimer at redhat dot com @ 2014-06-26 14:22 UTC (permalink / raw)
To: glibc-bugs
https://sourceware.org/bugzilla/show_bug.cgi?id=13763
Florian Weimer <fweimer at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Flags| |security-
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2014-06-26 14:22 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-27 8:53 [Bug libc/13763] New: bindresvport() function is multithread-unsafe penght at cn dot fujitsu.com
2012-05-09 6:59 ` [Bug libc/13763] " penght at cn dot fujitsu.com
2012-09-19 2:03 ` penght at cn dot fujitsu.com
2012-09-19 2:06 ` penght at cn dot fujitsu.com
2012-10-31 15:07 ` carlos_odonell at mentor dot com
2012-11-19 6:58 ` carlos_odonell at mentor dot com
2014-06-26 14:22 ` fweimer at redhat dot com
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).