km4arr / openpgm

Automatically exported from code.google.com/p/openpgm
0 stars 0 forks source link

Segfault on illumos in getifaddr() #25

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
We found it with ZMQ using PGM sockets on illumos.

OpenPGM uses its own structure pgm_ifaddrs_t which follows system ifaddrs. On 
linux. 

On illumos ifaddrs.ifa_flags is *uint64_t* [1], on linux - *unsigned int*

Thus, getifaddrs ((struct ifaddrs**)ifap) can damage memory, and it does it :-) 
(file openpgm/pgm/getifaddrs.c)

[1] http://src.illumos.org/source/xref/illumos-gate/usr/src/head/ifaddrs.h#38

Original issue reported on code.google.com by pashev.i...@gmail.com on 17 Sep 2012 at 4:22

GoogleCodeExporter commented 9 years ago
One would normally expect illumos to follow Solaris and provide SIOCGLIFCONF 
such that this not incredibly bad assumption would survive.  Thus I expect 
illumos has both now and that is causing the failure.  Will amend, thanks.

Original comment by fnjo...@gmail.com on 17 Sep 2012 at 5:16

GoogleCodeExporter commented 9 years ago
Resolved in r1475, please reverify on illumos.

Original comment by fnjo...@gmail.com on 22 Sep 2012 at 1:54

GoogleCodeExporter commented 9 years ago
It works! (tm)

Thanks.

Original comment by pashev.i...@gmail.com on 24 Sep 2012 at 8:38