hostapd: Segmentation fault when using WPA with nl80211

Tim Connolly voyd
Thu Jun 5 07:34:34 PDT 2008

On Wed, 4 Jun 2008 11:16:32 +0300, Jouni Malinen wrote:

>> I have been able to successfully get an open AP going but when trying to use
>> WPA I consistently get a segmentation fault during negotiation. This seems to
>> be happening when returning from driver_nl80211.c:get_key_handler().
> Could you please try running hostapd under valgrind or gdb to get full
> backtrace of functions at the time of the segmentation fault?

WPA: 00:12:f0:76:03:b9 WPA_PTK entering state PTKCALCNEGOTIATING2
WPA: 00:12:f0:76:03:b9 WPA_PTK entering state PTKINITNEGOTIATING
==20514== Invalid read of size 4
==20514==    at 0x40350D4: (within /usr/local/lib/
==20514==    by 0x80759DC: i802_get_seqnum (driver_nl80211.c:329)
==20514==    by 0x804C1C1: hostapd_wpa_auth_get_seqnum (driver.h:245)
==20514==    by 0x80636A7: sm_WPA_PTK_PTKINITNEGOTIATING_Enter (wpa.c:120)
==20514==    by 0x8063F0C: wpa_sm_step (wpa.c:1645)
==20514==    by 0x8064882: wpa_receive (wpa.c:827)
==20514==    by 0x80785F7: handle_eapol (driver_nl80211.c:1703)
==20514==    by 0x806BC52: eloop_sock_table_dispatch (eloop.c:159)
==20514==    by 0x806C204: eloop_run (eloop.c:506)
==20514==    by 0x804E100: main (hostapd.c:1969)
==20514==  Address 0x6DC is not stack'd, malloc'd or (recently) free'd

>> While composing this message I realised that to get hostapd to build I had
>> commented out the following line in driver_nl80211.c:
>>    #include <net/if.h>
>> and left the following line uncommented in Makefile:
>>     CFLAGS += -DUSE_KERNEL_HEADERS -I/usr/src/linux/include
> I've resolved the header file conflicts in the current development
> version of hostapd by replacing '#include <linux/wireless>' with
> '#include "wireless_copy.h"' in driver_nl80211.c. What made you
> uncomment the USE_KERNEL_HEADERS definition?

I'm running Debian Etch so the glibc headers were only from 2.6.18, or 
2.6.22 if I used backports - so <linux/nl80211.h> is missing a lot of 
required symbols.

More information about the Hostap mailing list