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

ASan crash in Aria write_tail() during COM_STMT_EXECUTE with server-side cursor

    XMLWordPrintable

Details

    • Can result in hang or crash

    Description

      A crafted binary-protocol prepared-statement execution crashes mariadbd.

      Steps to reproduce:
      1. Start a disposable MariaDB test server.
      2. Install dependency: pip install mysql-connector-python
      3. Run the attached reproducer:
      python3 reproduce.py -H <host> -P <port> -u <user> -p <password>

      The reproducer first executes the embedded setup SQL to recreate database `mydb` and prepare the minimized schema/data required by the crash. It then prepares a statement with COM_STMT_PREPARE and sends crafted COM_STMT_EXECUTE packet(s).

      Actual result:
      mariadbd crashes.

      Crash signature:
      storage/maria/ma_blockrec.c:2001 write_tail()
      AddressSanitizer CHECK failed while reporting invalid memory access

      Expected result:
      The server should return an error or reject the malformed/edge-case prepared-statement execution without crashing.

      Attachments:

      • reproduce.py
      • error.log

      Attachments

        1. reproduce.py
          57 kB
        2. mdev-40304.test
          10 kB
        3. error.log
          5 kB

        Activity

          People

            serg Sergei Golubchik
            ycybfhb Hongbo Feng
            Votes:
            0 Vote for this issue
            Watchers:
            3 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.