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

[PATCH] Storage plugin can caush segfault in table.cc init_tmp_table_share()

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 10.0.1
    • Fix Version/s: 10.0.4
    • Component/s: None
    • Labels:
      None

      Description

      (Context: I'm working with Arjen Lentz on opengraph )

      If a plugin passes a NULL tablename to init_tmp_table_share() this causes a segfault.

      If I assume that the core mysqld should be robust, this should be trapped (although not necessarily able to prevent a related segfault elsewhere in the storage plugin)

      I have attached a patch that deals with this, by checking the arguments that are otherwise dereferenced by strlen() before it is used and either ASSERTs in debug build or returning with a warning log.

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            serg Sergei Golubchik added a comment -

            Not really. We don't add checks everywhere against improper usage.
            Not even in the client-server API. Think of it, even glibc does not — try to call strcmp with a NULL pointer.

            And in this particular case if the plugin invokes init_tmp_table_share without a table name, than something is seriously wrong with it. And failing gracefully here won't help, the plugin will probably just crash later or produce some weird results.

            Show
            serg Sergei Golubchik added a comment - Not really. We don't add checks everywhere against improper usage. Not even in the client-server API. Think of it, even glibc does not — try to call strcmp with a NULL pointer. And in this particular case if the plugin invokes init_tmp_table_share without a table name, than something is seriously wrong with it. And failing gracefully here won't help, the plugin will probably just crash later or produce some weird results.

              People

              • Assignee:
                serg Sergei Golubchik
                Reporter:
                andymc73 Andrew McDonnell
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: