Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-28331

Hashicorp: Assertion `key_len == sizeof(key->key)' failed in scheme_get_key upon loading a key of a wrong length

    XMLWordPrintable

Details

    Description

      # The test presumes that the local vault is running at $VAULT_ADDR,
      # and the token is configured in $VAULT_TOKEN
       
      --source include/have_innodb.inc
       
      --exec vault secrets disable bug
      --exec vault secrets enable -path /bug -version=2 kv
      --exec vault kv put /bug/1 data=01234567890123456789012345678901
       
      --let $restart_parameters= --plugin-load-add=hashicorp_key_management --hashicorp-key-management-vault-url="$VAULT_ADDR/v1/bug/" --hashicorp-key-management-token="$VAULT_TOKEN"
      --source include/restart_mysqld.inc
       
      create table t (a int) engine=InnoDB encrypted=yes;
       
      --exec vault kv put /bug/1 data=0123456789012345
       
      --source include/restart_mysqld.inc
       
      # Cleanup
      drop table t;
      --exec vault secrets disable bug
      

      preview-10.9-MDEV-20119-misc e62a2a061

      mariadbd: /data/src/preview-10.9-misc-debug/sql/encryption.cc:173: uint scheme_get_key(st_encryption_scheme*, st_encryption_scheme_key*): Assertion `key_len == sizeof(key->key)' failed.
      220417 18:45:40 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007f45e9640662 in __GI___assert_fail (assertion=0x55e920b77cda "key_len == sizeof(key->key)", file=0x55e920b77cf8 "/data/src/preview-10.9-misc-debug/sql/encryption.cc", line=173, function=0x55e920b77d30 "uint scheme_get_key(st_encryption_scheme*, st_encryption_scheme_key*)") at assert.c:101
      #8  0x000055e92003b944 in scheme_get_key (scheme=0x7f45980297b8, key=0x7ffcf82c9ca0) at /data/src/preview-10.9-misc-debug/sql/encryption.cc:173
      #9  0x000055e92003ba6e in do_crypt (src=0x7f45de56c01a "", slen=16354, dst=0x55e92427c01a '\217' <repeats 200 times>..., dlen=0x7ffcf82c9d84, scheme=0x7f45980297b8, key_version=2, i32_1=5, i32_2=1, i64=49279, flag=3) at /data/src/preview-10.9-misc-debug/sql/encryption.cc:214
      #10 0x000055e92003bb67 in encryption_scheme_encrypt (src=0x7f45de56c01a "", slen=16354, dst=0x55e92427c01a '\217' <repeats 200 times>..., dlen=0x7ffcf82c9d84, scheme=0x7f45980297b8, key_version=2, i32_1=5, i32_2=1, i64=49279) at /data/src/preview-10.9-misc-debug/sql/encryption.cc:233
      #11 0x000055e92087bb0c in fil_encrypt_buf_for_full_crc32 (crypt_data=0x7f45980297b8, space=5, offset=1, lsn=49279, src_frame=0x7f45de56c000 "", dst_frame=0x55e92427c000 "") at /data/src/preview-10.9-misc-debug/storage/innobase/fil/fil0crypt.cc:529
      #12 0x000055e92087bcb7 in fil_encrypt_buf (crypt_data=0x7f45980297b8, space=5, offset=1, src_frame=0x7f45de56c000 "", zip_size=0, dst_frame=0x55e92427c000 "", use_full_checksum=true) at /data/src/preview-10.9-misc-debug/storage/innobase/fil/fil0crypt.cc:568
      #13 0x000055e92087be87 in fil_space_encrypt (space=0x7f459803bca8, offset=1, src_frame=0x7f45de56c000 "", dst_frame=0x55e92427c000 "") at /data/src/preview-10.9-misc-debug/storage/innobase/fil/fil0crypt.cc:621
      #14 0x000055e9207facf2 in buf_page_encrypt (space=0x7f459803bca8, bpage=0x7f45de498a40, s=0x7f45de56c000 "", slot=0x7ffcf82c9f30, size=0x7ffcf82c9f28) at /data/src/preview-10.9-misc-debug/storage/innobase/buf/buf0flu.cc:722
      #15 0x000055e920803efe in buf_page_t::flush (this=0x7f45de498a40, lru=false, space=0x7f459803bca8) at /data/src/preview-10.9-misc-debug/storage/innobase/buf/buf0flu.cc:894
      #16 0x000055e9207fd7e0 in buf_do_flush_list_batch (max_n=2000, lsn=18446744073709551615) at /data/src/preview-10.9-misc-debug/storage/innobase/buf/buf0flu.cc:1493
      #17 0x000055e9207fdd52 in buf_flush_list (max_n=2000, lsn=18446744073709551615) at /data/src/preview-10.9-misc-debug/storage/innobase/buf/buf0flu.cc:1569
      #18 0x000055e920801697 in buf_flush_buffer_pool () at /data/src/preview-10.9-misc-debug/storage/innobase/buf/buf0flu.cc:2615
      #19 0x000055e9205cb39b in logs_empty_and_mark_files_at_shutdown () at /data/src/preview-10.9-misc-debug/storage/innobase/log/log0log.cc:1136
      #20 0x000055e920729622 in innodb_shutdown () at /data/src/preview-10.9-misc-debug/storage/innobase/srv/srv0start.cc:1682
      #21 0x000055e9204f3c88 in innobase_end () at /data/src/preview-10.9-misc-debug/storage/innobase/handler/ha_innodb.cc:4255
      #22 0x000055e920114adf in ha_finalize_handlerton (plugin=0x55e923b64530) at /data/src/preview-10.9-misc-debug/sql/handler.cc:596
      #23 0x000055e91fd914f7 in plugin_deinitialize (plugin=0x55e923b64530, ref_check=true) at /data/src/preview-10.9-misc-debug/sql/sql_plugin.cc:1271
      #24 0x000055e91fd919d1 in reap_plugins () at /data/src/preview-10.9-misc-debug/sql/sql_plugin.cc:1342
      #25 0x000055e91fd93edc in plugin_shutdown () at /data/src/preview-10.9-misc-debug/sql/sql_plugin.cc:2050
      #26 0x000055e91fbcfe8f in clean_up (print_message=true) at /data/src/preview-10.9-misc-debug/sql/mysqld.cc:1959
      #27 0x000055e91fbd83d6 in mysqld_main (argc=159, argv=0x55e923a2d6a0) at /data/src/preview-10.9-misc-debug/sql/mysqld.cc:5897
      #28 0x000055e91fbcc535 in main (argc=26, argv=0x7ffcf82caaa8) at /data/src/preview-10.9-misc-debug/sql/main.cc:34
      

      File key management plugin in a similar situation refuses to load complaining about an invalid key.

      Attachments

        Issue Links

          Activity

            People

              sysprg Julius Goryavsky
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.