fragattacks/src
Davide Caratti 5db86df6a8 macsec_linux: Fix NULL pointer dereference on error cases
In case wpa_supplicant is using driver_macsec_linux, but macsec module
is not (yet) loaded in the kernel, nl_socket_alloc() fails and drv->sk
is NULL. In this case, don't call libnl functions rntl_link_add() or
rtnl_link_change() using such NULL pointer, to prevent program from
getting segmentation faults like:

 Program received signal SIGSEGV, Segmentation fault.
 nl_socket_get_local_port (sk=sk@entry=0x0) at socket.c:365
 365             if (sk->s_local.nl_pid == 0) {
 (gdb) p sk
 $1 = (const struct nl_sock *) 0x0
 (gdb) bt
 #0  nl_socket_get_local_port (sk=sk@entry=0x0) at socket.c:365
 #1  0x00007ffff79c56a0 in nl_complete_msg (sk=sk@entry=0x0,
  msg=msg@entry=0x55555595a1f0) at nl.c:491
 #2  0x00007ffff79c56d1 in nl_send_auto (sk=sk@entry=0x0,
  msg=msg@entry=0x55555595a1f0) at nl.c:522
 #3  0x00007ffff79c652f in nl_send_sync (sk=sk@entry=0x0,
  msg=0x55555595a1f0) at nl.c:556
 #4  0x00007ffff755faf5 in rtnl_link_add (sk=0x0,
  link=link@entry=0x55555595b0f0, flags=flags@entry=1024) at route/link.c:1548
 #5  0x000055555567a298 in macsec_drv_create_transmit_sc (priv=0x55555593b130,
  sc=0x55555593b320, conf_offset=<optimized out>) at ../src/drivers/driver_macsec_linux.c:998

Signed-off-by: Davide Caratti <davide.caratti@gmail.com>
2017-03-26 21:13:21 +03:00
..
ap FILS: Add FILS SK auth PFS support in AP mode 2017-03-12 23:20:32 +02:00
common QCA vendor attributes to extend antenna diversity functionality 2017-03-15 21:30:00 +02:00
crypto Return success/failure result from sha384_prf() 2017-03-12 20:43:06 +02:00
drivers macsec_linux: Fix NULL pointer dereference on error cases 2017-03-26 21:13:21 +03:00
eap_common Use os_memdup() 2017-03-07 13:19:10 +02:00
eap_peer Use os_memdup() 2017-03-07 13:19:10 +02:00
eap_server Use os_memdup() 2017-03-07 13:19:10 +02:00
eapol_auth Use os_memdup() 2017-03-07 13:19:10 +02:00
eapol_supp RSN: Fix pre-authentication EAPOL-Start startPeriod configuration 2017-02-20 12:48:04 +02:00
fst FST: Silence compiler warning on WPA_ASSERT 2017-01-29 18:45:29 +02:00
l2_packet tests: Add TEST_FAIL() checks in l2_packet 2017-03-04 11:43:58 +02:00
p2p P2P: Run full P2P_FIND scan after pending scan completes 2017-03-14 20:41:08 +02:00
pae mka: Fix use-after-free when transmit secure channels are deleted 2017-03-26 21:13:21 +03:00
radius Use os_memdup() 2017-03-07 13:19:10 +02:00
rsn_supp FILS: Add FILS SK auth PFS support in STA mode 2017-03-12 23:20:32 +02:00
tls Use os_memdup() 2017-03-07 13:19:10 +02:00
utils Use os_memdup() 2017-03-07 13:19:10 +02:00
wps Use os_memdup() 2017-03-07 13:19:10 +02:00
lib.rules Add QUIET=1 option for make 2014-12-29 15:49:05 +02:00
Makefile FST: Add the Fast Session Transfer (FST) module 2015-07-16 18:26:15 +03:00