[OpenAFS] crashes in rx library on 64-Bit systems, affecting klog, aklog, etc...

Rainer Toebbicke rtb@pclella.cern.ch
Wed, 14 Dec 2005 16:27:12 +0100


This is a multi-part message in MIME format.
--------------000603090607030503010702
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Some xdr_XXXX routines in src/rx use osi_alloc() which is defined as 
returning a char * in rx_misc.c, but do not declare it.
Consequently, the function call is considered to return an int which 
truncates the pointer on systems (e.g. ia64) where an intis shorter 
than a char *. Affected are xdr_array.c (hence everything calling 
pr_SNameToId()) and xdr_reference.c.

The attached patch declares osi_alloc by including the "rx.h" file 
which also deals with the special cases (e.g. the different #define 
for kernel code).

Remark: somebody has obviously noticed this already and tried to cast 
the result of osi_alloc using (caddr_t) - I see an xdr_arrayn.c there 
which has this. BUT: it does not work like that - casting an int to 
something bigger doesn't recover the previous contents.

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Rainer Toebbicke
European Laboratory for Particle Physics(CERN) - Geneva, Switzerland
Phone: +41 22 767 8985       Fax: +41 22 767 7155

--------------000603090607030503010702
Content-Type: text/plain;
 name="patch_64bit"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="patch_64bit"

--- openafs/src/rx/xdr_array.c.o141	2005-12-14 13:45:31.000000000 +0100
+++ openafs/src/rx/xdr_array.c	2005-12-14 14:46:51.000000000 +0100
@@ -28,6 +28,7 @@
  */
 #include <afsconfig.h>
 #include <afs/param.h>
+#include "rx.h"
 
 RCSID
     ("$Header: /cvs/openafs/src/rx/xdr_array.c,v 1.9.2.1 2004/12/07 06:10:06 shadow Exp $");
--- openafs/src/rx/xdr_refernce.c.o141	2003-07-16 01:16:13.000000000 +0200
+++ openafs/src/rx/xdr_refernce.c	2005-12-14 14:47:07.000000000 +0100
@@ -28,6 +28,7 @@
  */
 #include <afsconfig.h>
 #include <afs/param.h>
+#include "rx.h"
 
 RCSID
     ("$Header: /cvs/openafs/src/rx/xdr_refernce.c,v 1.6 2003/07/15 23:16:13 shadow Exp $");

--------------000603090607030503010702--