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

unsafe error handing around ll_splice_alias()

    XMLWordPrintable

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

          People

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

            Dates

              Created:
              Updated:
              Resolved: