strongswan/src
Ansis Atteka 4334735605 updown: fix segfault when interface name can't be resolved
The child_updown() function sets up environment variables to the updown
script. Sometimes call to hydra->kernel_interface->get_interface() could
fail and iface variable could be left uninitialized. This patch fixes
this issue by passing "unknown" as interface name.

Here is the stacktrace:

0  0x00007fa90791f445 in raise () from /lib/x86_64-linux-gnu/libc.so.6
1  0x00007fa907922bab in abort () from /lib/x86_64-linux-gnu/libc.so.6
2  0x0000000000401ed7 in segv_handler (signal=11) at charon.c:183
3  <signal handler called>
4  0x00007fa90793221f in vfprintf () from /lib/x86_64-linux-gnu/libc.so.6
5  0x00007fa9079f0580 in __vsnprintf_chk () from /lib/x86_64-linux-gnu/libc.so.6
6  0x00007fa9079f04c8 in __snprintf_chk () from /lib/x86_64-linux-gnu/libc.so.6
7  0x00007fa8f9b95b86 in snprintf (
    __fmt=0x7fa8f9b961b8 "2>&1 PLUTO_VERSION='1.1' PLUTO_VERB='%s%s%s' PLUTO_CONNECTION='%s' PLUTO_INTERFACE='%s' PLUTO_REQID='%u' PLUTO_ME='%H' PLUTO_MY_ID='%Y' PLUTO_MY_CLIENT='%H/%u' PLUTO_MY_PORT='%u' PLUTO_MY_PROTOCOL='%u"..., __n=1024, __s=0x7fa8f7923440 "2>&1 PLUTO_VERSION='1.1' PLUTO_VERB='up-host' PLUTO_CONNECTION='remote-40.0.0.40' PLUTO_INTERFACE='\367\250\177")
    at /usr/include/x86_64-linux-gnu/bits/stdio2.h:65
8  child_updown (this=0x8486b0, ike_sa=0x7fa8e4005f80, child_sa=0x7fa8d4008290, up=true) at updown_listener.c:308
9  0x00007fa907ecc11c in ?? () from /usr/lib/strongswan/libcharon.so.0
10 0x00007fa907ef89bf in ?? () from /usr/lib/strongswan/libcharon.so.0
11 0x00007fa907ef2fc8 in ?? () from /usr/lib/strongswan/libcharon.so.0
12 0x00007fa907ee84ff in ?? () from /usr/lib/strongswan/libcharon.so.0
13 0x00007fa907ee3067 in ?? () from /usr/lib/strongswan/libcharon.so.0
14 0x00007fa90835e8fb in ?? () from /usr/lib/strongswan/libstrongswan.so.0
15 0x00007fa908360d30 in ?? () from /usr/lib/strongswan/libstrongswan.so.0
16 0x00007fa907cade9a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
17 0x00007fa9079db4bd in clone () from /lib/x86_64-linux-gnu/libc.so.6
18 0x0000000000000000 in ?? ()

Signed-Off-By: Ansis Atteka <aatteka@nicira.com>
2013-10-30 09:29:41 +01:00
..
_copyright automake: replace INCLUDES by AM_CPPFLAGS 2013-07-18 14:59:19 +02:00
_updown updown: Properly configure ICMP[v6] message type and code in firewall rules 2013-10-17 16:57:39 +02:00
_updown_espmark updown: remove description of unsupported PLUTO_ variables 2013-08-08 14:48:32 +02:00
charon automake: replace INCLUDES by AM_CPPFLAGS 2013-07-18 14:59:19 +02:00
charon-cmd Build generated man pages via configure script 2013-09-13 14:32:51 +02:00
charon-nm ike: support multiple addresses, ranges and subnets in IKE address config 2013-09-04 10:38:37 +02:00
charon-tkm kernel: Use a time_t to report use time in query_policy() 2013-10-11 10:23:17 +02:00
checksum checksum: The pool utility was moved to its own directory 2013-10-11 17:42:29 +02:00
conftest conftest: Don't load plugins incrementally 2013-09-13 11:44:04 +02:00
dumm automake: replace INCLUDES by AM_CPPFLAGS 2013-07-18 14:59:19 +02:00
frontends charon-xpc: Load missing eap-md5 plugin after enabling it 2013-10-28 15:18:11 +01:00
include kernel-netlink: Check existence of linux/fib_rules.h, don't include it in distribution 2013-10-18 09:52:54 +02:00
ipsec ipsec: Updated ipsec(8) 2013-10-29 17:22:45 +01:00
libcharon updown: fix segfault when interface name can't be resolved 2013-10-30 09:29:41 +01:00
libfast Build all shared libraries with -no-undefined and link them properly 2013-09-12 01:44:49 +02:00
libhydra kernel-netlink: Check existence of linux/fib_rules.h, don't include it in distribution 2013-10-18 09:52:54 +02:00
libimcv Updated and split data.sql 2013-10-23 00:26:02 +02:00
libipsec libipsec: Don't print ciphertext with ICV in log message 2013-10-17 11:43:58 +02:00
libpts swid: Properly clean up after reading SWID tag 2013-10-29 13:18:05 +01:00
libpttls Doxygen fixes 2013-10-15 11:25:55 +02:00
libradius Build all shared libraries with -no-undefined and link them properly 2013-09-12 01:44:49 +02:00
libsimaka Build all shared libraries with -no-undefined and link them properly 2013-09-12 01:44:49 +02:00
libstrongswan utils: Include stdio.h for fmemopen() replacement 2013-10-29 16:18:35 +01:00
libtls Build all shared libraries with -no-undefined and link them properly 2013-09-12 01:44:49 +02:00
libtnccs libtnccs: Add dummy entry to pb_tnc_tcg_msg_infos 2013-10-29 13:36:15 +01:00
libtncif automake: replace INCLUDES by AM_CPPFLAGS 2013-07-18 14:59:19 +02:00
manager automake: replace INCLUDES by AM_CPPFLAGS 2013-07-18 14:59:19 +02:00
medsrv automake: replace INCLUDES by AM_CPPFLAGS 2013-07-18 14:59:19 +02:00
openac automake: replace INCLUDES by AM_CPPFLAGS 2013-07-18 14:59:19 +02:00
pki pki: Replace BUILD_FROM_FD with passing a chunk via BUILD_BLOB 2013-10-23 17:20:39 +02:00
pool database: Add support for serializable transactions 2013-10-11 15:29:10 +02:00
pt-tls-client pt-tls-client: Report loaded plugins 2013-09-12 01:44:49 +02:00
scepclient automake: replace INCLUDES by AM_CPPFLAGS 2013-07-18 14:59:19 +02:00
starter ipsec_types: Add utility function to parse mark_t from strings 2013-10-11 15:32:44 +02:00
stroke starter: Add an 'ah' keyword for Authentication Header Security Associations 2013-10-11 10:15:20 +02:00
Makefile.am pool: Move the pool utility to its own directory in src 2013-10-11 15:16:05 +02:00
strongswan.conf Remove plugin load directives from default strongswan.conf 2010-07-13 14:28:11 +02:00