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

unsafe error handing around ll_splice_alias()

Details

    • 3
    • 9839

    Description

      Under memory pressure, ll_d_init() may fail to allocate a ll_dentry_data for the passed in dentry. When this happens ll_splice_alias() will return ERR_PTR(-ENOMEM). In ll_lookup_it() via ll_statahead_enter() and ll_lookup_it_finish() (which both call ll_splice_alias()) this err pointer will be assigned to both retval and dentry. Then on the way out this invalid dentry will be passed to ll_statahead_mark() thereby causing an oops.

      ll_lookup_it(parent, dentry, ...)
              ll_statahead_enter(parent, &dentry, 0)
                      do_statahead_enter(parent, &dentry, 0)
                              dentry = ll_splice_alias(parent, dentry)
                                      ll_d_init(dentry)
              ll_lookup_it_finish(parent, &dentry,...)
                              dentry = ll_splice_alias(parent, dentry)
                                      ll_d_init(dentry)
      

      A similar situation may exist in ll_revalidate_nd().

      Attachments

        Activity

          [LU-3807] unsafe error handing around ll_splice_alias()
          jhammond John Hammond added a comment -

          Patch landed to master. Thanks Swapnil.

          jhammond John Hammond added a comment - Patch landed to master. Thanks Swapnil.

          I have added a patch to fix this issue --> http://review.whamcloud.com/#/c/7460/

          spimpale Swapnil Pimpale (Inactive) added a comment - I have added a patch to fix this issue --> http://review.whamcloud.com/#/c/7460/

          People

            jhammond John Hammond
            jhammond John Hammond
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: