aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2015-02-04don't create oversize bignums in binary matchingMikael Pettersson
Bignums are artifically restricted in size. Arithmetic and logical operations check the sizes of resulting bignums, and turn oversize results into system_limit exceptions. However, this check is not performed when bignums are constructed by binary matching. The consequence is that such matchings can construct oversize bignums that satisfy is_integer/1 yet don't work. Performing arithmetic such as Term - 0 fails with a system_limit exception. Worse, performing a logical operation such as Term band Term results in []. The latter occurs because the size checking (e.g. in erts_band()) is a simple ASSERT(is_not_nil(...)) on the result of the bignum operation, which internally is [] (NIL) in the case of oversize results. However, ASSERT is a no-op in release builds, so the error goes unnoticed and [] is returned as the result of the band/2. This patch addresses this by preventing oversize bignums from entering the VM via binary matching: - the internal bytes_to_big() procedure is augmented to return NIL for oversize results, just like big_norm() - callers of bytes_to_big() are augmented to check for NIL returns and signal errors in those cases - erts_bs_get_integer_2() can only fail with badmatch, so that is the Erlang-level result of oversize bignums from binary matches - big_SUITE.erl is extended with a test case that fails without this fix (no error signalled) and passes with it (badmatch occurs) Credit goes to Nico Kruber for the initial bug report.
2015-02-03Merge branch 'maint-17' into maintZandra Hird
2015-02-03Update primary bootstrapBjörn Gustavsson
2015-02-03Merge branch 'bjorn/compiler/map-bugs/OTP-12451' into maintBjörn Gustavsson
* bjorn/compiler/map-bugs/OTP-12451: Be more careful about map patterns when evalutating element/2 Do not convert map patterns to map expressions
2015-02-03Be more careful about map patterns when evalutating element/2Björn Gustavsson
We must not convert map patterns to map expressions.
2015-02-03Do not convert map patterns to map expressionsBjörn Gustavsson
In code such as: case {a,Map} of {a,#{}}=T -> T end we must NOT rewrite a map pattern to a map expression like this: case Map of #{} -> {a,#{}} end because the pattern '#{}' will match any map, but the expression '#{}' will construct an empty map.
2015-02-02Merge branch 'ia/ssl/self-signed-root/OTP-12449' into maintIngela Anderton Andin
* ia/ssl/self-signed-root/OTP-12449: ssl: Remove selfsigned anchor certificate from the certificate chain
2015-01-30ssl: Remove selfsigned anchor certificate from the certificate chainIngela Anderton Andin
A selfsigned trusted anchor should not be in the certifcate chain passed to the certificate path validation. Conflicts: lib/ssl/src/ssl_certificate.erl
2015-01-30Updated OTP versionOTP-17.4.1Erlang/OTP
2015-01-30Prepare releaseErlang/OTP
2015-01-30Merge branch 'egil/fix-getifaddrs-realloc/OTP-12445' into maint-17Erlang/OTP
* egil/fix-getifaddrs-realloc/OTP-12445: erts: Fix getifaddrs realloc ptr mismatch
2015-01-30Merge branch 'egil/fix-child_setup-close/OTP-12446' into maint-17Erlang/OTP
* egil/fix-child_setup-close/OTP-12446: erts: Use closefrom() if available when closing fds erts: Don't close all fds twice in child_setup
2015-01-30Merge branch 'egil/fix-crashdump-epmd/OTP-12447' into maint-17Erlang/OTP
* egil/fix-crashdump-epmd/OTP-12447: erts: Check driver version before assigning callback erts: Don't lookup invalid port for crashdump handling erts: Reserve a file descriptor for the crashdump file erts: Use emergency close to close epmd erts: Extend driver interface with emergency_close
2015-01-30Merge branch ↵Erlang/OTP
'ia/maint/inets/invalid-content-length/mod_alias_https/consistent_keep_alive_timeout/OTP-12429/OTP-12436' into maint-17 * ia/maint/inets/invalid-content-length/mod_alias_https/consistent_keep_alive_timeout/OTP-12429/OTP-12436: inets: Consistent view of configuration parameter keep_alive_timeout inets: httpd - mod_alias now handles https URIs inets: httpd - Sanity check of content-length header
2015-01-30inets: Consistent view of configuration parameter keep_alive_timeoutIngela Anderton Andin
2015-01-30inets: httpd - mod_alias now handles https URIsIngela Anderton Andin
2015-01-29erts: Fix getifaddrs realloc ptr mismatchBjörn-Egil Dahlberg
When a buffer was exhausted and subsequently a realloc, we could get an invalid pointer. For this to occur we would need to have a realloc to lower adresses. The symptom would be garbage returned from erlang:port_control(Port, 25, []) (prim_inet:getifaddrs(Port) resulting in a badarg) or a segmentation fault.
2015-01-29inets: httpd - Sanity check of content-length headerIngela Anderton Andin
Gracefully handle invalid content-lenght headers instead of crashing in list_to_integer.
2015-01-29Merge branch '0xAX/inets-typo-fix' into maintBruce Yinhe
* 0xAX/inets-typo-fix: lib/inets: fix typo in httpd_load_test example
2015-01-27erts: Use closefrom() if available when closing fdsBjörn-Egil Dahlberg
closefrom() was only used in the vfork() case before, now also used in the fork() case.
2015-01-27erts: Don't close all fds twice in child_setupBjörn-Egil Dahlberg
The commit c2b4eab25c907f453a394d382c04cd04e6c06b49 introduced an error in which child_setup erroneously tried to close all file descriptors twice.
2015-01-27Merge branch 'maint-r16' into maintMarcus Arendt
2015-01-26Merge branch 's1n4/httpc_invalid_set_cookies/OTP-12430' into maintMarcus Arendt
* s1n4/httpc_invalid_set_cookies/OTP-12430: httpc: Avoid parsing invalid 'Set-Cookie' headers
2015-01-26Prepare releaseErlang/OTP
2015-01-26Merge branch 'sverk/port_get_data-race-r16b03/OTP-12208' into maint-r16Erlang/OTP
* sverk/port_get_data-race-r16b03/OTP-12208: erts: Fix port data memory allocation bug erts: Mend port_set_data with non-immed data for halfword VM erts: Add test case for port_set_data and port_get_data erts: Fix race between port_set_data, port_get_data and port termination erts: Fix erlang:port_set_data/2 for non immediate data
2015-01-26Merge branch 'marcus/16/fix-rebuild' into maint-r16Erlang/OTP
* marcus/16/fix-rebuild: Sort keys before generating
2015-01-26Merge branch 'ia/ssh/sftp-v3-flags' into maintIngela Anderton Andin
* ia/ssh/sftp-v3-flags: ssh: Add some more flags ssh: Correct Sftp flag handling ssh: Add handling of sftp v3 flags
2015-01-26Merge branch 'ia/ssl/maint/poddle/OTP-12420' into maintIngela Anderton Andin
* ia/ssl/maint/poddle/OTP-12420: ssl: Reenable padding check for TLS-1.0 and provide backwards compatible disable option
2015-01-24lib/inets: fix typo in httpd_load_test example0xAX
2015-01-23Merge branch 'egil/fix-lcnt/OTP-12364' into maintBjörn-Egil Dahlberg
* egil/fix-lcnt/OTP-12364: tools: Fix lcnt printout of histograms tools: Fix lcnt sort of inspected locks
2015-01-23erts: Check driver version before assigning callbackBjörn-Egil Dahlberg
2015-01-23erts: Don't lookup invalid port for crashdump handlingBjörn-Egil Dahlberg
2015-01-23erts: Reserve a file descriptor for the crashdump fileBjörn-Egil Dahlberg
2015-01-23erts: Use emergency close to close epmdBjörn-Egil Dahlberg
Closes all open socket before writing crashdump to file.
2015-01-23Merge branch 'nox/standard_error/OTP-12424' into maintMarcus Arendt
* nox/standard_error/OTP-12424: Test standard_error Properly handle broken input in standard_error Fix io:getopts(standard_error)
2015-01-23Merge branch 'marcus/rabbe-doc-typos2/OTP-12399' into maintMarcus Arendt
* marcus/rabbe-doc-typos2/OTP-12399: fix spelling
2015-01-23ssl: Reenable padding check for TLS-1.0 and provide backwards compatibleIngela Anderton Andin
disable option Conflicts: lib/ssl/src/ssl_cipher.erl lib/ssl/src/ssl_record.erl lib/ssl/src/tls_record.erl lib/ssl/test/ssl_cipher_SUITE.erl
2015-01-23ssh: Add some more flagsIngela Anderton Andin
2015-01-23ssh: Correct Sftp flag handlingIngela Anderton Andin
Function name was somewhat confusing and when trying to find a better name for it we realised it did not work as intended.
2015-01-23ssh: Add handling of sftp v3 flagsIngela Anderton Andin
2015-01-21erts: Fix port data memory allocation bugSverker Eriksson
for non-immediate port data >= sizeof(Eterm)*2 words.
2015-01-21erts: Mend port_set_data with non-immed data for halfword VMSverker Eriksson
2015-01-21erts: Add test case for port_set_data and port_get_dataSverker Eriksson
2015-01-21erts: Fix race between port_set_data, port_get_data and port terminationSverker Eriksson
Always update prt->data with atomic xchg-op. Check for NULL data to detect racing port terminator. Use NULL, as THE_NON_VALUE can be a valid pointer on debug VM.
2015-01-21erts: Fix erlang:port_set_data/2 for non immediate dataSverker Eriksson
hsize field was not set leading to VM crash
2015-01-21Update primary bootstrapBjörn Gustavsson
2015-01-21Merge branch 'bjorn/compiler/map-pattern/OTP-12414' into maintBjörn Gustavsson
* bjorn/compiler/map-pattern/OTP-12414: core_lib: Handle patterns in map values
2015-01-20Test standard_errorAnthony Ramine
2015-01-20Properly handle broken input in standard_errorAnthony Ramine
io:put_chars(standard_error, [oops]) could previously crash the standard_error process. Reported-by: Alexei Sholik
2015-01-20httpc: Avoid parsing invalid 'Set-Cookie' headersSina Samavati
Parsing invalid 'Set-Cookie' header would make httpc crash. This commit filters invalid 'Set-Cookie' headers so that httpc wouldn't try to parse them.