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

ASAN global-buffer-overflow in Item_func_latlongfromgeohash::decode_geohash

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • None
    • 12.0
    • GIS
    • None

    Description

      SELECT ST_LatFromGeoHash("ї");
      SELECT ST_LongFromGeoHash("ї");
      

      bb-11.7-mdev-34120-gis-functions branch

      Version: '11.7.0-MariaDB-debug'  socket: '/11.8/dt/my.sock'  port: 3314  Source distribution
      =================================================================
      ==353691==ERROR: AddressSanitizer: global-buffer-overflow on address 0x5563ae842117 at pc 0x5563ac9a69eb bp 0x7fa74860b010 sp 0x7fa74860b000
      READ of size 1 at 0x5563ae842117 thread T12 (one_connection)
          #0 0x5563ac9a69ea in Item_func_latlongfromgeohash::decode_geohash(String*, double*, double*) /11.8/src/sql/item_geofunc.cc:3048
          #1 0x5563ac9a7273 in Item_func_latlongfromgeohash::val_real() /11.8/src/sql/item_geofunc.cc:3182
          #2 0x5563ac5593bd in Type_handler::Item_send_double(Item*, Protocol*, st_value*) const /11.8/src/sql/sql_type.cc:7731
          #3 0x5563ac577afb in Type_handler_double::Item_send(Item*, Protocol*, st_value*) const /11.8/src/sql/sql_type.h:6348
          #4 0x5563aba1e8b9 in Item::send(Protocol*, st_value*) /11.8/src/sql/item.h:1255
          #5 0x5563abaf6bc3 in Protocol::send_result_set_row(List<Item>*) /11.8/src/sql/protocol.cc:1359
          #6 0x5563abcb0309 in select_send::send_data(List<Item>&) /11.8/src/sql/sql_class.cc:3279
          #7 0x5563ac001a9c in select_result_sink::send_data_with_check(List<Item>&, st_select_lex_unit*, unsigned long long) /11.8/src/sql/sql_class.h:6179
          #8 0x5563abf250a6 in JOIN::exec_inner() /11.8/src/sql/sql_select.cc:4900
          #9 0x5563abf23ba5 in JOIN::exec() /11.8/src/sql/sql_select.cc:4812
          #10 0x5563abf28463 in mysql_select(THD*, TABLE_LIST*, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*) /11.8/src/sql/sql_select.cc:5345
          #11 0x5563abef5e99 in handle_select(THD*, LEX*, select_result*, unsigned long long) /11.8/src/sql/sql_select.cc:628
          #12 0x5563abe11e00 in execute_sqlcom_select /11.8/src/sql/sql_parse.cc:6154
          #13 0x5563abe019aa in mysql_execute_command(THD*, bool) /11.8/src/sql/sql_parse.cc:3954
          #14 0x5563abe1ce5f in mysql_parse(THD*, char*, unsigned int, Parser_state*) /11.8/src/sql/sql_parse.cc:7876
          #15 0x5563abdf3474 in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool) /11.8/src/sql/sql_parse.cc:1892
          #16 0x5563abdf0117 in do_command(THD*, bool) /11.8/src/sql/sql_parse.cc:1405
          #17 0x5563ac2f7c09 in do_handle_one_connection(CONNECT*, bool) /11.8/src/sql/sql_connect.cc:1448
          #18 0x5563ac2f7594 in handle_one_connection /11.8/src/sql/sql_connect.cc:1350
          #19 0x5563ad006195 in pfs_spawn_thread /11.8/src/storage/perfschema/pfs.cc:2198
          #20 0x7fa776153608 in start_thread /build/glibc-FcRMwW/glibc-2.31/nptl/pthread_create.c:477
          #21 0x7fa775c8e352 in __clone (/lib/x86_64-linux-gnu/libc.so.6+0x11f352) (BuildId: 0323ab4806bee6f846d9ad4bccfc29afdca49a58)
       
      0x5563ae842117 is located 17 bytes after global variable '*.LC319' defined in '/11.8/src/sql/item_geofunc.cc' (0x5563ae8420c0) of size 70
        '*.LC319' is ascii string 'void Item_func_geohash::encode_geohash(String*, double, double, uint)'
      SUMMARY: AddressSanitizer: global-buffer-overflow /11.8/src/sql/item_geofunc.cc:3048 in Item_func_latlongfromgeohash::decode_geohash(String*, double*, double*)
      Shadow bytes around the buggy address:
        0x5563ae841e80: 00 00 00 00 00 00 00 00 00 00 00 02 f9 f9 f9 f9
        0x5563ae841f00: 00 03 f9 f9 f9 f9 f9 f9 00 00 00 01 f9 f9 f9 f9
        0x5563ae841f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        0x5563ae842000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        0x5563ae842080: 00 00 01 f9 f9 f9 f9 f9 00 00 00 00 00 00 00 00
      =>0x5563ae842100: 06 f9[f9]f9 f9 f9 f9 f9 00 00 00 00 00 00 00 00
        0x5563ae842180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        0x5563ae842200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        0x5563ae842280: f9 f9 f9 f9 00 00 00 00 00 00 00 00 00 00 02 f9
        0x5563ae842300: f9 f9 f9 f9 00 00 02 f9 f9 f9 f9 f9 00 f9 f9 f9
        0x5563ae842380: f9 f9 f9 f9 00 00 00 00 00 00 00 00 00 00 00 00
      Shadow byte legend (one shadow byte represents 8 application bytes):
        Addressable:           00
        Partially addressable: 01 02 03 04 05 06 07 
        Heap left redzone:       fa
        Freed heap region:       fd
        Stack left redzone:      f1
        Stack mid redzone:       f2
        Stack right redzone:     f3
        Stack after return:      f5
        Stack use after scope:   f8
        Global redzone:          f9
        Global init order:       f6
        Poisoned by user:        f7
        Container overflow:      fc
        Array cookie:            ac
        Intra object redzone:    bb
        ASan internal:           fe
        Left alloca redzone:     ca
        Right alloca redzone:    cb
      Thread T12 (one_connection) created by T0 here:
          #0 0x7fa77661d175 in __interceptor_pthread_create ../../../../src/libsanitizer/asan/asan_interceptors.cpp:208
          #1 0x5563ad001db9 in my_thread_create /11.8/src/storage/perfschema/my_thread.h:38
          #2 0x5563ad006588 in pfs_spawn_thread_v1 /11.8/src/storage/perfschema/pfs.cc:2249
          #3 0x5563ab9f123e in inline_mysql_thread_create /11.8/src/include/mysql/psi/mysql_thread.h:1139
          #4 0x5563aba0abb7 in create_thread_to_handle_connection(CONNECT*) /11.8/src/sql/mysqld.cc:6270
          #5 0x5563aba0b222 in create_new_thread(CONNECT*) /11.8/src/sql/mysqld.cc:6332
          #6 0x5563aba0b54f in handle_accepted_socket(st_mysql_socket, st_mysql_socket) /11.8/src/sql/mysqld.cc:6394
          #7 0x5563aba0c24c in handle_connections_sockets() /11.8/src/sql/mysqld.cc:6507
          #8 0x5563aba0a3af in mysqld_main(int, char**) /11.8/src/sql/mysqld.cc:6165
          #9 0x5563ab9f033c in main /11.8/src/sql/main.cc:34
          #10 0x7fa775b93082 in __libc_start_main ../csu/libc-start.c:308
       
      ==353691==ABORTING
      

      Attachments

        Issue Links

          Activity

            There are no comments yet on this issue.

            People

              Gosselin Dave Gosselin
              alice Alice Sherepa
              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.