Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-20448

posix_acl leak in llite DEFAULT-ACL fetch path

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • Lustre 2.18.0
    • None
    • None
    • 3
    • 9223372036854775807

       

      ll_get_acl_common() in lustre/llite/acl.c leaks one posix_acl object per default-ACL fetch that reaches the get path. The ACL_TYPE_DEFAULT branch calls posix_acl_dup() on a fresh acl that already has refcount 1 and no other owner; the caller releases only one reference, orphaning the object.

       

      Reproduction

      D=/mnt/lustre/acltest; mkdir -p $D
      setfacl -d -m u:1000:rwx $D          # default ACL
      loop(){ for i in $(seq $1); do
                lctl set_param ldlm.namespaces.*mdc*.lru_size=clear >/dev/null
                getfacl $2 $D >/dev/null; done; }
      # measure kmalloc-96 (grep '^kmalloc-96 ' /proc/slabinfo) around each,
      # with `echo 3 > /proc/sys/vm/drop_caches` before/after to free legit caches
      loop 20000 -d          # DEFAULT (leaking path)
      loop 20000 --access    # ACCESS  (control)

      Result

       

       

       Loop (N=20000) kmalloc-96 delta after drop_caches
      DEFAULT (getfacl -d) +19989 (~1 leak/call, ~1.9 MB)
      ACCESS (getfacl --access) +16 (noise, no leak)

      found by commit-hunter-v1

       

            skoyama Sohei Koyama
            skoyama Sohei Koyama
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: