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

LP:910817 - Race condition in kill_threads_for_user

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Resolution: Fixed
    • None
    • None
    • None

    Description

      kill_threads_for_user has a race condition which can result in invalid pointer in the threads_to_kill list.

      while ((ptr= it++))

      { ptr->awake(kill_signal); mysql_mutex_unlock(&ptr->LOCK_thd_data); (*rows)++; }

      The problem with this code is that once ptr->LOCK_thd_data is unlocked, very short thereafter memory pointed to by
      'ptr' can be freed, and the ptr->next becomes invalid, and ptr=it++ might crash.

      Possible fix would be calculating 'next' pointer before unlocking the LOCK_thd_data.

      Attachments

        Activity

          People

            knielsen Kristian Nielsen
            wlad Vladislav Vaintroub
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

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