This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch, master, updated. glibc-2.14-545-g4efbd5c


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  4efbd5cb39dfa170056532185c724ab2ff545585 (commit)
      from  aff2453df710c872588572a31928cff0e47da5b7 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=4efbd5cb39dfa170056532185c724ab2ff545585

commit 4efbd5cb39dfa170056532185c724ab2ff545585
Author: Ulrich Drepper <drepper@gmail.com>
Date:   Sun Dec 4 13:20:06 2011 -0500

    Fix aliasing issues in RPC code

diff --git a/ChangeLog b/ChangeLog
index ad891be..6416f9e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2011-12-04  Ulrich Drepper  <drepper@gmail.com>
+
+	* sunrpc/clnt_unix.c (clntunix_control): Fix aliasing issues.
+	* sunrpc/clnt_tcp.c (clnttcp_control): Likewise.
+	* sunrpc/clnt_udp.c (clntudp_call): Likewise.
+
 2011-12-03  Ulrich Drepper  <drepper@gmail.com>
 
 	* inet/netinet/in.h: Provide versions of IN6_IS_ADDR_UNSPECIFIED,
diff --git a/sunrpc/clnt_tcp.c b/sunrpc/clnt_tcp.c
index 7cfbe9e..d1fc43d 100644
--- a/sunrpc/clnt_tcp.c
+++ b/sunrpc/clnt_tcp.c
@@ -364,6 +364,8 @@ static bool_t
 clnttcp_control (CLIENT *cl, int request, char *info)
 {
   struct ct_data *ct = (struct ct_data *) cl->cl_private;
+  u_long *mcall_ptr;
+  u_long ul;
 
 
   switch (request)
@@ -393,11 +395,24 @@ clnttcp_control (CLIENT *cl, int request, char *info)
        * first element in the call structure *.
        * This will get the xid of the PREVIOUS call
        */
+#if 0
+      /* This original code has aliasing issues.  */
       *(u_long *)info = ntohl (*(u_long *)ct->ct_mcall);
+#else
+      mcall_ptr = (u_long *)ct->ct_mcall;
+      ul = ntohl (*mcall_ptr);
+      memcpy (info, &ul, sizeof (ul));
+#endif
       break;
     case CLSET_XID:
       /* This will set the xid of the NEXT call */
+#if 0
+      /* This original code has aliasing issues.  */
       *(u_long *)ct->ct_mcall =  htonl (*(u_long *)info - 1);
+#else
+      ul = ntohl (*(u_long *)info - 1);
+      memcpy (ct->ct_mcall, &ul, sizeof (ul));
+#endif
       /* decrement by 1 as clnttcp_call() increments once */
       break;
     case CLGET_VERS:
diff --git a/sunrpc/clnt_udp.c b/sunrpc/clnt_udp.c
index babee9a..294e13a 100644
--- a/sunrpc/clnt_udp.c
+++ b/sunrpc/clnt_udp.c
@@ -473,8 +473,7 @@ send_again:
       /* see if reply transaction id matches sent id.
 	Don't do this if we only wait for a replay */
       if (xargs != NULL
-	  && (*((u_int32_t *) (cu->cu_inbuf))
-	      != *((u_int32_t *) (cu->cu_outbuf))))
+	  && memcmp (cu->cu_inbuf, cu->cu_outbuf, sizeof (u_int32_t)) != 0)
 	continue;
       /* we now assume we have the proper reply */
       break;
diff --git a/sunrpc/clnt_unix.c b/sunrpc/clnt_unix.c
index 62dc8c6..282127b 100644
--- a/sunrpc/clnt_unix.c
+++ b/sunrpc/clnt_unix.c
@@ -338,7 +338,8 @@ static bool_t
 clntunix_control (CLIENT *cl, int request, char *info)
 {
   struct ct_data *ct = (struct ct_data *) cl->cl_private;
-
+  u_long *mcall_ptr;
+  u_long ul;
 
   switch (request)
     {
@@ -366,11 +367,24 @@ clntunix_control (CLIENT *cl, int request, char *info)
        * first element in the call structure *.
        * This will get the xid of the PREVIOUS call
        */
+#if 0
+      /* This original code has aliasing issues.  */
       *(u_long *) info = ntohl (*(u_long *)ct->ct_mcall);
+#else
+      mcall_ptr = (u_long *)ct->ct_mcall;
+      ul = ntohl (*mcall_ptr);
+      memcpy (info, &ul, sizeof (ul));
+#endif
       break;
     case CLSET_XID:
       /* This will set the xid of the NEXT call */
+#if 0
+      /* This original code has aliasing issues.  */
       *(u_long *) ct->ct_mcall =  htonl (*(u_long *)info - 1);
+#else
+      ul = ntohl (*(u_long *)info - 1);
+      memcpy (ct->ct_mcall, &ul, sizeof (ul));
+#endif
       /* decrement by 1 as clntunix_call() increments once */
       break;
     case CLGET_VERS:

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog          |    6 ++++++
 sunrpc/clnt_tcp.c  |   15 +++++++++++++++
 sunrpc/clnt_udp.c  |    3 +--
 sunrpc/clnt_unix.c |   16 +++++++++++++++-
 4 files changed, 37 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]