Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-18456 TCU: Trash Can/Undelete for Lustre
  3. LU-21121

TCU: trash stub/uid dirs created before permission and ENOTEMPTY checks (leak, DoS)

XMLWordPrintable

    • Icon: Technical task Technical task
    • Resolution: Unresolved
    • Icon: Medium Medium
    • None
    • None
    • None
    • 3
    • 9223372036854775807

      Problem

      mdd_unlink() (mdd_dir.c:2163-2179) and mdd_rename() (:3713-3727) call mdd_trash_param_prep() before mdd_unlink_sanity_check() and before the not-empty check.

      prep runs mdd_trash_create() in its own committed transactions to create:

      • the per-uid dir
      • the pFID stub
      • for striped dirs, a full striped stub via mdd_trash_striped_create() (a cross-MDT DTX)

      Consequences:

      • An rm the user has no permission for, or an rmdir of a non-empty dir, still leaves persistent trash directories behind.
      • Nothing garbage-collects them.
      • An unprivileged user can drive repeated distributed transactions.

      Reproducer

      1. Count the objects under .lustre/.ltrash.
      1. Attempt a denied rm, then rmdir of a non-empty plain dir and of a non-empty striped dir.
      1. Count the objects again.

      Expected: the count is unchanged.

      Suggested fix

      Run prep after the sanity checks, ideally creating the stubs inside the unlink transaction. Otherwise, GC empty stubs.

            qian_wc Qian Yingjin
            qian_wc Qian Yingjin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: