public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/1548] New: glibc sunrpc svc_getreqset is broken
@ 2005-10-25 21:10 jlan at engr dot sgi dot com
  2005-11-03 21:39 ` [Bug libc/1548] " cvs-commit at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: jlan at engr dot sgi dot com @ 2005-10-25 21:10 UTC (permalink / raw)
  To: glibc-bugs

We ran into problems with a RPC client. File descriptors 32-63, 96-127, 
... are not being handled properly.

The svc_run implementation is calling svc_getreqset.
This function is broken because it is using ffs() to find bits
set in the fd_set * passed to it:

  maskp = readfds->fds_bits;
  for (sock = 0; sock < setsize; sock += NFDBITS)
    for (mask = *maskp++; (bit = ffs (mask)); mask ^= (1 << (bit - 1)))
      INTUSE(svc_getreq_common) (sock + bit - 1);

ffs() requires an int argument, but in .../sys/select.h we find

typedef long int __fd_mask;

The problem was reported in 2.3.3 version, but the problem still exists 
in glibc-2.3.5-10.3.

The problem can be fixed by using ffsl() instead.


--- glibc-2.3/sunrpc/svc.c      2004-02-09 02:47:53 -08:00
+++ glibc-2.3-fix/sunrpc/svc.c  2005-10-24 16:45:50 -07:00
@@ -372,7 +372,7 @@ svc_getreqset (fd_set *readfds)
     setsize = FD_SETSIZE;
   maskp = readfds->fds_bits;
   for (sock = 0; sock < setsize; sock += NFDBITS)
-    for (mask = *maskp++; (bit = ffs (mask)); mask ^= (1 << (bit - 1)))
+    for (mask = *maskp++; (bit = ffsl (mask)); mask ^= (1L << (bit - 1)))
       INTUSE(svc_getreq_common) (sock + bit - 1);
 }
 INTDEF (svc_getreqset)

-- 
           Summary: glibc sunrpc svc_getreqset is broken
           Product: glibc
           Version: 2.3.5
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
        AssignedTo: drepper at redhat dot com
        ReportedBy: jlan at engr dot sgi dot com
                CC: glibc-bugs at sources dot redhat dot com,tee at sgi dot
                    com


http://sourceware.org/bugzilla/show_bug.cgi?id=1548

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug libc/1548] glibc sunrpc svc_getreqset is broken
  2005-10-25 21:10 [Bug libc/1548] New: glibc sunrpc svc_getreqset is broken jlan at engr dot sgi dot com
@ 2005-11-03 21:39 ` cvs-commit at gcc dot gnu dot org
  2005-11-03 23:19 ` jlan at engr dot sgi dot com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-11-03 21:39 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-11-03 21:39 -------
Subject: Bug 1548

CVSROOT:	/cvs/glibc
Module name:	libc
Changes by:	roland@sources.redhat.com	2005-11-03 21:39:36

Modified files:
	sunrpc         : svc.c 

Log message:
	2005-11-03  Roland McGrath  <roland@redhat.com>
	
	[BZ #1548]
	* sunrpc/svc.c (svc_getreqset): Use ffsl instead of ffs on fd_mask.
	From Jay Lan <jlan@engr.sgi.com>.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sunrpc/svc.c.diff?cvsroot=glibc&r1=1.18&r2=1.19



-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=1548

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug libc/1548] glibc sunrpc svc_getreqset is broken
  2005-10-25 21:10 [Bug libc/1548] New: glibc sunrpc svc_getreqset is broken jlan at engr dot sgi dot com
  2005-11-03 21:39 ` [Bug libc/1548] " cvs-commit at gcc dot gnu dot org
@ 2005-11-03 23:19 ` jlan at engr dot sgi dot com
  2005-11-03 23:30 ` cvs-commit at gcc dot gnu dot org
  2005-12-23 15:22 ` drepper at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: jlan at engr dot sgi dot com @ 2005-11-03 23:19 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From jlan at engr dot sgi dot com  2005-11-03 23:19 -------
The patch mentioned in Comment#1 is different from what i submitted. 
Without "L" in the statement below 
    ... mask ^= (1L << (bit - 1))) 
you still lose LSB 32 bits in 64 bit machines. 
 
- jay 

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=1548

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug libc/1548] glibc sunrpc svc_getreqset is broken
  2005-10-25 21:10 [Bug libc/1548] New: glibc sunrpc svc_getreqset is broken jlan at engr dot sgi dot com
  2005-11-03 21:39 ` [Bug libc/1548] " cvs-commit at gcc dot gnu dot org
  2005-11-03 23:19 ` jlan at engr dot sgi dot com
@ 2005-11-03 23:30 ` cvs-commit at gcc dot gnu dot org
  2005-12-23 15:22 ` drepper at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-11-03 23:30 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-11-03 23:30 -------
Subject: Bug 1548

CVSROOT:	/cvs/glibc
Module name:	libc
Changes by:	roland@sources.redhat.com	2005-11-03 23:30:45

Modified files:
	sunrpc         : svc.c 

Log message:
	2005-11-03  Roland McGrath  <roland@redhat.com>
	
	[BZ #1548]
	* sunrpc/svc.c (svc_getreqset): Use ffsl instead of ffs on fd_mask,
	make sure constant is long.
	From Jay Lan <jlan@engr.sgi.com>.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sunrpc/svc.c.diff?cvsroot=glibc&r1=1.19&r2=1.20



-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=1548

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug libc/1548] glibc sunrpc svc_getreqset is broken
  2005-10-25 21:10 [Bug libc/1548] New: glibc sunrpc svc_getreqset is broken jlan at engr dot sgi dot com
                   ` (2 preceding siblings ...)
  2005-11-03 23:30 ` cvs-commit at gcc dot gnu dot org
@ 2005-12-23 15:22 ` drepper at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: drepper at redhat dot com @ 2005-12-23 15:22 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From drepper at redhat dot com  2005-12-23 15:22 -------
Patch has been applied.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


http://sourceware.org/bugzilla/show_bug.cgi?id=1548

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-12-23 15:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-25 21:10 [Bug libc/1548] New: glibc sunrpc svc_getreqset is broken jlan at engr dot sgi dot com
2005-11-03 21:39 ` [Bug libc/1548] " cvs-commit at gcc dot gnu dot org
2005-11-03 23:19 ` jlan at engr dot sgi dot com
2005-11-03 23:30 ` cvs-commit at gcc dot gnu dot org
2005-12-23 15:22 ` drepper 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).