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

mysql-test: collect_mysqld_features uses --datadir=. and may write into installed test suite dir

    XMLWordPrintable

Details

    • Not for Release Notes

    Description

      While running MTR as a non-root user, the "Checking supported features…" phase calls collect_mysqld_features() in mysql-test/mariadb-test-run.pl, which probes:

      mariadbd --no-defaults --datadir=. ... --verbose --help
      

      When the test suite is executed from an installed location (e.g. /usr/share/mariadb/mariadb-test), --datadir=. makes MariaDB treat that installed directory as the datadir for the probe. During startup, MariaDB may run the datadir case-sensitivity check (test_if_case_insensitive() in sql/mysqld.cc), which attempts to create a *.lower-test file in the datadir.

      This is a poor fit for installed test-suite paths that are effectively read-only, and it also triggers denials in restricted envs (for instance, AppArmor enforce mode). Example denial observed:

      apparmor="DENIED" operation="mknod" name="/usr/share/mariadb/mariadb-test/mariadb-aa.lower-test" requested_mask="c"
      

      Steps to reproduce:

      1. Install the MariaDB test suite so it resides under a shared read-only path (for instance, /usr/share/mariadb/mariadb-test).

      2. Run MTR as a non-root user from that directory (or otherwise ensure collect_mysqld_features() runs with --datadir=. pointing to that installed tree).

      3. Observe that mariadbd --verbose --help probe may attempt to create *.lower-test in that directory.

      Notes:

      This is not AppArmor-specific, AppArmor just makes the write attempt visible/fatal

      Attachments

        Activity

          People

            danblack Daniel Black
            aquila Aquila Macedo
            Votes:
            0 Vote for this issue
            Watchers:
            4 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.