curl/lib
Ivan Avdeev 31c521b047 vtls: fix ssl session cache race condition
Sessionid cache management is inseparable from managing individual
session lifetimes. E.g. for reference-counted sessions (like those in
SChannel and OpenSSL engines) every session addition and removal
should be accompanied with refcount increment and decrement
respectively. Failing to do so synchronously leads to a race condition
that causes symptoms like use-after-free and memory corruption.
This commit:
 - makes existing session cache locking explicit, thus allowing
   individual engines to manage lock's scope.
 - fixes OpenSSL and SChannel engines by putting refcount management
   inside this lock's scope in relevant places.
 - adds these explicit locking calls to other engines that use
   sessionid cache to accommodate for this change. Note, however,
   that it is unknown whether any of these engines could also have
   this race.

Bug: https://github.com/curl/curl/issues/815
Fixes #815
Closes #847
2016-06-01 09:40:55 +02:00
..
vauth URLs: change http to https in many places 2016-04-06 11:58:34 +02:00
vtls vtls: fix ssl session cache race condition 2016-06-01 09:40:55 +02:00
.gitignore
amigaos.c code: style updates 2016-04-03 22:38:36 +02:00
amigaos.h
arpa_telnet.h
asyn-ares.c lib: include curl_printf.h as one of the last headers 2016-04-29 22:32:49 +02:00
asyn-thread.c lib: include curl_printf.h as one of the last headers 2016-04-29 22:32:49 +02:00
asyn.h
base64.c lib: include curl_printf.h as one of the last headers 2016-04-29 22:32:49 +02:00
checksrc.pl checksrc.pl: Added variants of strcat() & strncat() to banned function list 2016-05-23 12:13:41 +01:00
CMakeLists.txt
config-amigaos.h
config-dos.h
config-mac.h
config-os400.h
config-riscos.h
config-symbian.h
config-tpf.h
config-vxworks.h
config-win32.h config-w32.h: Fixed compilation warning when /Wall enabled 2016-03-19 11:05:06 +00:00
config-win32ce.h
conncache.c connections: non-HTTP proxies on different ports aren't reused either 2016-05-03 08:18:15 +02:00
conncache.h
connect.c connect: fix invalid "Network is unreachable" errors 2016-05-08 14:29:26 +02:00
connect.h
content_encoding.c
content_encoding.h
cookie.c lib: include curl_printf.h as one of the last headers 2016-04-29 22:32:49 +02:00
cookie.h
curl_addrinfo.c lib: include curl_printf.h as one of the last headers 2016-04-29 22:32:49 +02:00
curl_addrinfo.h
curl_base64.h
curl_config.h.cmake cmake: Added missing mbedTLS support 2016-05-30 23:09:52 +02:00
curl_des.c
curl_des.h
curl_endian.c
curl_endian.h
curl_fnmatch.c memdebug: Ensure curl/curl.h is included before curl_memory.h 2016-04-01 13:21:12 +01:00
curl_fnmatch.h
curl_gethostname.c
curl_gethostname.h
curl_gssapi.c GSS: make Curl_gss_log_error more verbose 2016-03-29 16:51:29 +02:00
curl_gssapi.h GSS: make Curl_gss_log_error more verbose 2016-03-29 16:51:29 +02:00
curl_hmac.h
curl_ldap.h
curl_md4.h
curl_md5.h
curl_memory.h includes: avoid duplicate memory callback typdefs even harder 2016-04-18 15:04:17 +02:00
curl_memrchr.c memdebug: Ensure curl/curl.h is included before curl_memory.h 2016-04-01 13:21:12 +01:00
curl_memrchr.h
curl_multibyte.c curl_multibyte: fix compiler error 2016-05-20 16:50:04 +02:00
curl_multibyte.h
curl_ntlm_core.c lib: include curl_printf.h as one of the last headers 2016-04-29 22:32:49 +02:00
curl_ntlm_core.h
curl_ntlm_wb.c lib: include curl_printf.h as one of the last headers 2016-04-29 22:32:49 +02:00
curl_ntlm_wb.h
curl_printf.h
curl_rtmp.c
curl_rtmp.h
curl_sasl.c lib: include curl_printf.h as one of the last headers 2016-04-29 22:32:49 +02:00
curl_sasl.h vauth: Moved the NTLM authentication code to the new vauth directory 2016-03-25 15:11:09 +00:00
curl_sec.h
curl_setup_once.h
curl_setup.h sendf.c: added ability to call recv() before send() as workaround 2016-04-20 09:22:48 +02:00
curl_sspi.c loadlibrary: Only load system DLLs from the system directory 2016-05-30 08:14:27 +02:00
curl_sspi.h
curl_threads.c memdebug: Ensure curl/curl.h is included before curl_memory.h 2016-04-01 13:21:12 +01:00
curl_threads.h
curlx.h
dict.c
dict.h
dotdot.c memdebug: Ensure curl/curl.h is included before curl_memory.h 2016-04-01 13:21:12 +01:00
dotdot.h
easy.c lib: include curl_printf.h as one of the last headers 2016-04-29 22:32:49 +02:00
easyif.h
escape.c lib: include curl_printf.h as one of the last headers 2016-04-29 22:32:49 +02:00
escape.h
file.c lib: include curl_printf.h as one of the last headers 2016-04-29 22:32:49 +02:00
file.h
fileinfo.c
fileinfo.h
firefox-db2pem.sh
formdata.c lib: include curl_printf.h as one of the last headers 2016-04-29 22:32:49 +02:00
formdata.h code: style updates 2016-04-03 22:38:36 +02:00
ftp.c lib: include curl_printf.h as one of the last headers 2016-04-29 22:32:49 +02:00
ftp.h
ftplistparser.c
ftplistparser.h
getenv.c
getinfo.c http: add CURLINFO_HTTP_VERSION and %{http_version} 2016-05-30 22:58:51 +02:00
getinfo.h
gopher.c
gopher.h
hash.c memdebug: Ensure curl/curl.h is included before curl_memory.h 2016-04-01 13:21:12 +01:00
hash.h
hmac.c memdebug: Ensure curl/curl.h is included before curl_memory.h 2016-04-01 13:21:12 +01:00
hostasyn.c
hostcheck.c
hostcheck.h
hostip4.c lib: include curl_printf.h as one of the last headers 2016-04-29 22:32:49 +02:00
hostip6.c lib: include curl_printf.h as one of the last headers 2016-04-29 22:32:49 +02:00
hostip.c lib: include curl_printf.h as one of the last headers 2016-04-29 22:32:49 +02:00
hostip.h
hostsyn.c
http2.c http2: use HTTP/2 in the HTTP/1.1-alike header 2016-05-19 11:16:30 +02:00
http2.h http2: Add Curl_http2_strerror for HTTP/2 error codes 2016-04-11 21:43:31 -04:00
http_chunks.c http_chunks: removed checksrc disable 2016-04-19 08:53:31 +02:00
http_chunks.h
http_digest.c lib: include curl_printf.h as one of the last headers 2016-04-29 22:32:49 +02:00
http_digest.h
http_negotiate.c lib: include curl_printf.h as one of the last headers 2016-04-29 22:32:49 +02:00
http_negotiate.h vauth: Moved the Negotiate authentication code to the new vauth directory 2016-03-26 17:21:22 +00:00
http_ntlm.c lib: include curl_printf.h as one of the last headers 2016-04-29 22:32:49 +02:00
http_ntlm.h http_ntlm: Renamed from curl_ntlm.[c|h] 2016-03-27 17:58:50 +01:00
http_proxy.c lib: include curl_printf.h as one of the last headers 2016-04-29 22:32:49 +02:00
http_proxy.h
http.c TLS: move the ALPN/NPN enable bits to the connection 2016-05-09 15:30:25 -04:00
http.h http2: Use size_t type for data drain count 2016-04-12 00:37:44 -04:00
idn_win32.c idn_win32: Use boolean based success codes 2016-03-11 07:24:39 +00:00
if2ip.c lib: include curl_printf.h as one of the last headers 2016-04-29 22:32:49 +02:00
if2ip.h
imap.c lib: include curl_printf.h as one of the last headers 2016-04-29 22:32:49 +02:00
imap.h
inet_ntop.c lib: include curl_printf.h as one of the last headers 2016-04-29 22:32:49 +02:00
inet_ntop.h
inet_pton.c inet_pton.c: Fixed compilation warnings 2016-03-20 11:14:58 +00:00
inet_pton.h
krb5.c lib: include curl_printf.h as one of the last headers 2016-04-29 22:32:49 +02:00
ldap.c lib: include curl_printf.h as one of the last headers 2016-04-29 22:32:49 +02:00
libcurl.def
libcurl.plist
libcurl.rc
libcurl.vers.in
llist.c memdebug: Ensure curl/curl.h is included before curl_memory.h 2016-04-01 13:21:12 +01:00
llist.h
Makefile.am lib/checksrc.whitelist: not needed anymore 2016-04-19 08:56:05 +02:00
makefile.amiga
Makefile.b32 build: Updated all makefiles and project files for the new vauth directory 2016-03-25 09:11:59 +00:00
makefile.dj
Makefile.inc loadlibrary: Only load system DLLs from the system directory 2016-05-30 08:14:27 +02:00
Makefile.m32 makefile.m32: add missing libs for static -winssl-ssh2 builds 2016-03-05 21:50:12 -05:00
Makefile.netware build: Updated all makefiles and project files for the new vauth directory 2016-03-25 09:11:59 +00:00
Makefile.vc6 loadlibrary: Only load system DLLs from the system directory 2016-05-30 08:14:27 +02:00
Makefile.vxworks
Makefile.Watcom build: Updated all makefiles and project files for the new vauth directory 2016-03-25 09:11:59 +00:00
md4.c
md5.c memdebug: Ensure curl/curl.h is included before curl_memory.h 2016-04-01 13:21:12 +01:00
memdebug.c memdebug: fix MSVC crash with -DMEMDEBUG_LOG_SYNC 2016-05-30 11:43:04 +02:00
memdebug.h memdebug.h: remove inclusion of other headers 2016-04-29 15:33:46 +02:00
mk-ca-bundle.pl
mk-ca-bundle.vbs
mprintf.c dprintf_formatf: fix (false?) Coverity warning 2016-05-17 09:06:32 +02:00
multi.c ftp wildcard: segfault due to init only in multi_perform 2016-05-15 00:37:36 +02:00
multihandle.h
multiif.h
netrc.c lib: include curl_printf.h as one of the last headers 2016-04-29 22:32:49 +02:00
netrc.h
non-ascii.c
non-ascii.h
nonblock.c
nonblock.h
nwlib.c nw: please the stricter checksrc 2016-04-03 23:07:30 +02:00
nwos.c nw: please the stricter checksrc 2016-04-03 23:07:30 +02:00
objnames-test08.sh
objnames-test10.sh
objnames.inc
openldap.c lib: include curl_printf.h as one of the last headers 2016-04-29 22:32:49 +02:00
parsedate.c
parsedate.h
pingpong.c lib: include curl_printf.h as one of the last headers 2016-04-29 22:32:49 +02:00
pingpong.h
pipeline.c pipeline: Sanity check pipeline pointer before accessing it. 2016-03-08 00:25:53 +01:00
pipeline.h
pop3.c lib: include curl_printf.h as one of the last headers 2016-04-29 22:32:49 +02:00
pop3.h
progress.c
progress.h
rawstr.c
rawstr.h
rtsp.c lib: include curl_printf.h as one of the last headers 2016-04-29 22:32:49 +02:00
rtsp.h
security.c
select.c
select.h
sendf.c lib: include curl_printf.h as one of the last headers 2016-04-29 22:32:49 +02:00
sendf.h
setup-os400.h
setup-vms.h
share.c code: style updates 2016-04-03 22:38:36 +02:00
share.h
sigpipe.h
slist.c memdebug: Ensure curl/curl.h is included before curl_memory.h 2016-04-01 13:21:12 +01:00
slist.h
smb.c
smb.h
smtp.c smtp: minor ident (white space) fixes 2016-05-23 12:59:58 +02:00
smtp.h
sockaddr.h
socks_gssapi.c lib: include curl_printf.h as one of the last headers 2016-04-29 22:32:49 +02:00
socks_sspi.c lib: include curl_printf.h as one of the last headers 2016-04-29 22:32:49 +02:00
socks.c code: style updates 2016-04-03 22:38:36 +02:00
socks.h
speedcheck.c
speedcheck.h
splay.c
splay.h code: style updates 2016-04-03 22:38:36 +02:00
ssh.c ssh: fix version number check typo 2016-05-30 08:14:27 +02:00
ssh.h SSH: new CURLOPT_QUOTE command "statvfs" 2016-03-27 17:52:16 +02:00
strdup.c memdebug: Ensure curl/curl.h is included before curl_memory.h 2016-04-01 13:21:12 +01:00
strdup.h
strequal.c
strequal.h
strerror.c lib: include curl_printf.h as one of the last headers 2016-04-29 22:32:49 +02:00
strerror.h
strtok.c
strtok.h
strtoofft.c
strtoofft.h
system_win32.c loadlibrary: Only load system DLLs from the system directory 2016-05-30 08:14:27 +02:00
system_win32.h loadlibrary: Only load system DLLs from the system directory 2016-05-30 08:14:27 +02:00
telnet.c loadlibrary: Only load system DLLs from the system directory 2016-05-30 08:14:27 +02:00
telnet.h
tftp.c lib: include curl_printf.h as one of the last headers 2016-04-29 22:32:49 +02:00
tftp.h
timeval.c
timeval.h
transfer.c ftp: fix incorrect out-of-memory code in Curl_pretransfer 2016-05-15 23:48:47 -04:00
transfer.h multi: multi_reconnect_request is the former Curl_reconnect_request 2016-03-30 07:52:28 +02:00
url.c URL parser: allow URLs to use one, two or three slashes 2016-05-30 23:13:55 +02:00
url.h CURLOPT_SOCKS5_GSSAPI_SERVICE: Merged with CURLOPT_PROXY_SERVICE_NAME 2016-04-09 20:47:05 +01:00
urldata.h vtls: fix ssl session cache race condition 2016-06-01 09:40:55 +02:00
version.c version: init moved to private name space, added protos 2016-03-17 00:55:46 +01:00
warnless.c warnless?: Added some integer based conversion functions 2016-03-26 11:09:01 +00:00
warnless.h warnless.h: Removed spurious character from commit 696bc6b9c9 2016-03-26 11:35:07 +00:00
wildcard.c lib: include curl_printf.h as one of the last headers 2016-04-29 22:32:49 +02:00
wildcard.h
x509asn1.c schannel: add CURLOPT_CERTINFO support 2016-06-01 08:50:01 +02:00
x509asn1.h schannel: add CURLOPT_CERTINFO support 2016-06-01 08:50:01 +02:00