summaryrefslogtreecommitdiff
path: root/sql/mf_iocache_encr.cc
Commit message (Collapse)AuthorAgeFilesLines
* Merge 10.2 into 10.3Marko Mäkelä2020-11-021-7/+8
|\
| * MDEV-22387: Do not violate __attribute__((nonnull))Marko Mäkelä2020-11-021-7/+8
| | | | | | | | | | | | | | | | | | | | | | This follows up commit commit 94a520ddbe39ae97de1135d98699cf2674e6b77e and commit 7c5519c12d46ead947d341cbdcbb6fbbe4d4fe1b. After these changes, the default test suites on a cmake -DWITH_UBSAN=ON build no longer fail due to passing null pointers as parameters that are declared to never be null, but plenty of other runtime errors remain.
* | Merge 10.2 into 10.3Marko Mäkelä2020-10-281-0/+10
|\ \ | |/
| * MDEV-23867: insert... select crash in compute_window_funcVarun Gupta2020-10-231-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are 2 issues here: Issue #1: memory allocation. An IO_CACHE that uses encryption uses a larger buffer (it needs space for the encrypted data, decrypted data, IO_CACHE_CRYPT struct to describe encryption parameters etc). Issue #2: IO_CACHE::seek_not_done When IO_CACHE objects are cloned, they still share the file descriptor. This means, operation on one IO_CACHE may change the file read position which will confuse other IO_CACHEs using it. The fix of these issues would be: Allocate the buffer to also include the extra size needed for encryption. Perform seek again after one IO_CACHE reads the file.
* | Merge 10.2 into 10.3Marko Mäkelä2019-05-141-1/+1
|\ \ | |/
| * Merge 10.1 into 10.2Marko Mäkelä2019-05-131-1/+1
| |\
| | * Merge branch '5.5' into 10.1Vicențiu Ciorbaru2019-05-111-1/+1
| | |
* | | Merge 10.2 into 10.3Marko Mäkelä2018-05-291-2/+2
|\ \ \ | |/ /
| * | Merge remote-tracking branch 'origin/10.1' into 10.2Monty2018-05-241-2/+2
| |\ \ | | |/
| | * MDEV-10259 mysqld crash with certain statement length and...sachin2018-05-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | order with Galera and encrypt-tmp-files=1 Problem:- If trans_cache (IO_CACHE) uses encrypted tmp file then on next DML server will crash. Case:- Lets take a case , we have a table t1 , We try to do 2 inserts in t1 1. A really long insert so that trans_cache has to use temp_file 2. Just a small insert Analysis:- Actually server crashes from inside of galera library. /lib64/libc.so.6(abort+0x175)[0x7fb5ba779dc5] /usr/lib64/galera/libgalera_smm.so(_ZN6galera3FSMINS_9TrxHandle5State... mysys/stacktrace.c:247(my_print_stacktrace)[0x7fb5a714940e] sql/signal_handler.cc:160(handle_fatal_signal)[0x7fb5a715c1bd] sql/wsrep_hton.cc:257(wsrep_rollback)[0x7fb5bcce923a] sql/wsrep_hton.cc:268(wsrep_rollback)[0x7fb5bcce9368] sql/handler.cc:1658(ha_rollback_trans(THD*, bool))[0x7fb5bcd4f41a] sql/handler.cc:1483(ha_commit_trans(THD*, bool))[0x7fb5bcd4f804] but actual issue is not in galera but in mariadb, because for 2nd insert we should never call rollback. We are calling rollback because log_and_order fails it fails because write_cache fails , It fails because after reinit_io_cache(trans_cache) , my_b_bytes_in_cache says 0 so we look into tmp_file for data , which is obviously wrong since temp was used for previous insert and it no longer exist. wsrep_write_cache_inc() reads the IO_CACHE in a loop, filling it with my_b_fill() until it returns "0 bytes read". Later MYSQL_BIN_LOG::write_cache() does the same. wsrep_write_cache_inc() assumes that reading a zero bytes past EOF leaves the old data in the cache Solution:- There is two issue in my_b_encr_read 1st we should never equal read_end to info->buffer. I mean this does not make sense read_end should always point to end of buffer. 2nd For most of the case(apart from async IO_CACHE) info->pos_in_file should be equal to info->buffer position wrt to temp file , since in this case we are not changing info->buffer it should remain unchanged.
* | | Merge bb-10.2-ext into 10.3Marko Mäkelä2018-02-151-2/+3
|\ \ \ | |/ /
| * | Merge branch '10.1' into 10.2Sergei Golubchik2018-02-111-2/+3
| |\ \ | | |/
| | * MDEV-14868 MariaDB server crashes after using ROLLBACK TO when ↵Sergei Golubchik2018-02-081-2/+3
| | | | | | | | | | | | | | | | | | | | | encrypt_tmp_files=ON Fix reinit_io_cache(WRITE_CACHE) with non-zero seek_offset. Run encryption.tempfiles with and without binlog checksums.
* | | MDEV-15091 : Windows, 64bit: reenable and fix warning C4267 (conversion from ↵Vladislav Vaintroub2018-02-061-4/+4
|/ / | | | | | | | | | | | | | | | | | | | | 'size_t' to 'type', possible loss of data) Handle string length as size_t, consistently (almost always:)) Change function prototypes to accept size_t, where in the past ulong or uint were used. change local/member variables to size_t when appropriate. This fix excludes rocksdb, spider,spider, sphinx and connect for now.
* | Fix several truncation and formatting warnings.Vladislav Vaintroub2017-10-031-2/+2
| |
* | MDEV-13384 - misc Windows warnings fixedVladislav Vaintroub2017-09-281-3/+3
|/
* make encrypt-binlog and encrypt-tmp-files to fail if no encryptionSergei Golubchik2015-09-091-14/+17
| | | | | | --encrypt-binlog and --encrypt-tmp-files used to mean "encrypt XXX if encryption is available, otherwise don't encrypt", now they mean "encrypt or fail with an error".
* New encryption API. Piece-wise encryption.Sergei Golubchik2015-09-041-7/+9
| | | | | | | | | | | | | Instead of encrypt(src, dst, key, iv) that encrypts all data in one go, now we have encrypt_init(key,iv), encrypt_update(src,dst), and encrypt_finish(dst). This also causes collateral changes in the internal my_crypt.cc encryption functions and in the encryption service. There are wrappers to provide the old all-at-once encryption functionality. But binlog events are often written piecewise, they'll need the new api.
* my_aes_get_size()Sergei Golubchik2015-06-021-1/+1
| | | | | return unsigned, not signed. return a value large enough for GCM
* just like tempfiles: use key id 2 for temp Aria tablesSergei Golubchik2015-06-021-2/+6
| | | | | introduce ENCRYPTION_KEY_SYSTEM_DATA and ENCRYPTION_KEY_TEMPORARY_DATA constants; use them everywhere.
* MDEV-8126 encryption for temp filesSergei Golubchik2015-06-021-0/+254
IO_CACHE tempfiles encryption