FreeRADIUS 3.0: Segfault in rlm_detail

Julius Plenz plenz at cis.fu-berlin.de
Tue Mar 4 16:14:06 CET 2014


Hi, Arran!

Additional info between the lines:

* Arran Cudbard-Bell <a.cudbardb at freeradius.org> [2014-03-04 15:52]:
> > #5  0x00007ffff79913b8 in vp_prints (out=0x7fffffffa751 "", outlen=1023, vp=0x7fffffffac20) at src/lib/print.c:868
        token = 0x0
        start = 0x7fffffffa751 ""
        len = 4222451713
        freespace = 1023
> > #6  0x00007ffff799154a in vp_print (fp=0xd31870, vp=0x7fffffffac20) at src/lib/print.c:908
        buf = "\t\000Ë", '\000' <repeats 45 times>, [more stuff...]
        p = 0x7fffffffa751 ""
        len = 13058144
> > #7  0x00007ffff3523e7e in detail_write (out=0xd31870, inst=0xd16a50, request=0xd31060, packet=0xd30ee0, compat=false)
> >    at src/modules/rlm_detail/rlm_detail.c:249
        src_vp = {da = 0x7e2260, next = 0x0, op = T_OP_EQ, tag = 0 '\000', value = {xlat = 0x0}, type = VT_NONE, length = 0, 
          data = {strvalue = 0x130a8582 <Address 0x130a8582 out of bounds>, octets = 0x130a8582 <Address 0x130a8582 out of bounds>, 
            ipaddr = {s_addr = 319456642}, ipv6addr = {__in6_u = {__u6_addr8 = "\202\205\n\023", '\000' <repeats 11 times>, 
                __u6_addr16 = {34178, 4874, 0, 0, 0, 0, 0, 0}, __u6_addr32 = {319456642, 0, 0, 0}}}, date = 319456642, 
            integer = 319456642, sinteger = 319456642, integer64 = 319456642, filter = {319456642, 0, 0, 0}, 
            ifid = "\202\205\n\023\000\000\000", ipv6prefix = "\202\205\n\023", '\000' <repeats 13 times>, 
            ipv4prefix = "\202\205\n\023\000", ether = "\202\205\n\023\000", tlv = 0x130a8582 <Address 0x130a8582 out of bounds>, 
            ptr = 0x130a8582}}
        dst_vp = {da = 0x7e2290, next = 0x0, op = T_OP_EQ, tag = 0 '\000', value = {xlat = 0x0}, type = VT_NONE, length = 0, 
          data = {strvalue = 0x45028582 <Address 0x45028582 out of bounds>, octets = 0x45028582 <Address 0x45028582 out of bounds>, 
            ipaddr = {s_addr = 1157793154}, ipv6addr = {__in6_u = {__u6_addr8 = "\202\205\002E", '\000' <repeats 11 times>, 
                __u6_addr16 = {34178, 17666, 0, 0, 0, 0, 0, 0}, __u6_addr32 = {1157793154, 0, 0, 0}}}, date = 1157793154, 
            integer = 1157793154, sinteger = 1157793154, integer64 = 1157793154, filter = {1157793154, 0, 0, 0}, 
            ifid = "\202\205\002E\000\000\000", ipv6prefix = "\202\205\002E", '\000' <repeats 13 times>, 
            ipv4prefix = "\202\205\002E\000", ether = "\202\205\002E\000", tlv = 0x45028582 <Address 0x45028582 out of bounds>, 
            ptr = 0x45028582}}
        vp = 0xcbc980
        timestamp = "2014-03-04 15:59:03\000" [more garbage]
> > #8  0x00007ffff35248c3 in detail_do (instance=0xd16a50, request=0xd31060, packet=0xd30ee0, compat=false)
    at src/modules/rlm_detail/rlm_detail.c:484
        outfd = 11
        buffer = "/server/devel/server/log/client/130.133.10.19/auth-20140304\000\a\000" [more garbage...]
        p = 0x7fffffffae9d "/auth-20140304"
        st = {st_dev = 65024, st_ino = 1610613986, st_nlink = 1, st_mode = 33152, st_uid = 999, st_gid = 100, __pad0 = 0, 
          st_rdev = 0, st_size = 150, st_blksize = 4096, st_blocks = 8, st_atim = {tv_sec = 1393944516, tv_nsec = 33683970}, 
          st_mtim = {tv_sec = 1393945050, tv_nsec = 117495477}, st_ctim = {tv_sec = 1393945050, tv_nsec = 117495477}, __unused = {
            0, 0, 0}}
        locked = 1
        lock_count = 0
        tv = {tv_sec = 4156364544, tv_usec = 0}
        fsize = 150
        outfp = 0xcbd750
        gid = 0
        grp = 0x3
        endptr = 0x0
        inst = 0xc74060

> > The file /server/devel/server/log/client/XXX.XXX.XX.XX/auth-20140304
> > is actually being created, but contains only this:
> > 
> >    2014-03-04 14:41:14
> >            Packet-Type = Access-Request
> > 
> > So presumably FreeRADIUS crashes while trying to print out the
> > Packet-Src-IP-Address...?
> 
> It shouldn't be trying to print Packet-Src-IP-Address as it isn't a
> real attribute.

Ah, okay? My old 2.X instance is doing exactly that: It prints e.g.

2014-03-04 00:00:05
        Packet-Type = Access-Request
        Packet-Src-IP-Address = ...
        Packet-Dst-IP-Address = ...
        Packet-Src-Port = 51585
        Packet-Dst-Port = 1812
        <read attributes follow>

That's why I was thinking it something's not correct before printing
the Packet-Src-IP-Address.

> Could you provide the contents of the request,

As I said, I send a fairly simple packet. From the FreeRADIUS debug
output, just before the detail module is called:

Ready to process requests.
rad_recv: Access-Request packet from host XXX.XXX.XX.XX port 42488, id=114, length=43
        User-Name = 'feh'
        User-Password = 'foobarbaz'

> > make: *** [build/objs/src/lib/cbuff.lo] Error 1
> 
> OK, what compiler/OS are you using.

GCC 4.4.5 from Debian oldstable 6.0 / Squeeze.

> It means that the preprocessor macros in ./build.h couldn't figure
> out the endianess of the system, which is odd as the Macros should
> cover at least GCC and clang.

Hmm. I don't know too much about this... but maybe this helps?

$ gcc -E -dU src/include/build.h
# 1 "src/include/build.h"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "src/include/build.h"
#undef __cplusplus
#define __GNUC_MINOR__ 4
#define __GNUC__ 4
#undef __APPLE__
#undef __clang__
src/include/build.h:84:6: error: #error Failed determining endianness of system
#undef __BIG_ENDIAN__
#undef __BYTE_ORDER__
#undef __LITTLE_ENDIAN__
#undef BIG_ENDIAN
#undef LITTLE_ENDIAN
#undef __SUNPRO_C

Julius


More information about the Freeradius-Users mailing list