libverto integration caused kadm5 unit tests to fail...

Greg Hudson ghudson at MIT.EDU
Sat Sep 24 10:43:09 EDT 2011

On Fri, 2011-09-23 at 19:21 -0400, Ezra Peisach wrote:
> Fedora 15 system, i386.  Running the lib/kadm5/unit-tests fails init 117 
> and then all tests fail.

This one evaded me for a while mainly because it's 32-bit specific and
my dev machine is 64-bit.  I was seeing the failure on the Solaris
32-bit nightly build, but the nature of that build environment made it
difficult to track down the bug there.  So, thanks for the additional
information; I was able to reproduce the bug using my 32-bit laptop.

The underlying cause of the bug predates the verto integration.
net-server.c uses a union for type-specific fields of struct connection,
but uses conn->u.tcp fields as well as conn->u.rpc fields for RPC
connections.  As part of the verto integration, a new RPC field
conn->u.rpc.closed was added to track whether the net-server loop is
force-closing an RPC connection.  On 32-bit platforms, reading the peer
address into conn->u.tcp.addrbuf causes conn->u.rpc.closed to be
non-zero, confusing free_socket() into causing a null pointer deref.

I will fix this by getting rid of the union.

More information about the krbdev mailing list