forked from illiliti/eiwd
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
handshake: Allow event handler to free handshake
Like in ap.c, allow the event callback to mark the handshake state as destroyed, without causing invalid accesses after the callback has returned. In this case the crash was because try_handshake_complete needed to access members of handshake_state after emitting the event, as well as access the netdev, which also has been destroyed: ==257707== Invalid read of size 8 ==257707== at 0x408C85: try_handshake_complete (netdev.c:1487) ==257707== by 0x408C85: try_handshake_complete (netdev.c:1480) (...) ==257707== Address 0x4e187e8 is 856 bytes inside a block of size 872 free'd ==257707== at 0x484621F: free (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==257707== by 0x437887: ap_stop_handshake (ap.c:151) ==257707== by 0x439793: ap_del_station (ap.c:316) ==257707== by 0x43EA92: ap_station_disconnect (ap.c:3411) ==257707== by 0x43EA92: ap_station_disconnect (ap.c:3399) ==257707== by 0x454276: p2p_group_event (p2p.c:1006) ==257707== by 0x439147: ap_event (ap.c:281) ==257707== by 0x4393AB: ap_new_rsna (ap.c:390) ==257707== by 0x4393AB: ap_handshake_event (ap.c:1010) ==257707== by 0x408C7F: try_handshake_complete (netdev.c:1485) ==257707== by 0x408C7F: try_handshake_complete (netdev.c:1480) (...)
- Loading branch information
1 parent
079489b
commit 4d2176d
Showing
3 changed files
with
34 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters