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

Suspicious dereference of pointer 'vma->vm_file' in ll_vm_{open|close}

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • Lustre 2.9.0
    • None
    • 3
    • 9223372036854775807

    Description

      static void ll_vm_open(struct vm_area_struct * vma)
      {
                  struct inode *inode    = file_inode(vma->vm_file); <== 'vma->vm_file' is dereferenced by being passed as argument 1 to function 'file_inode'.
                  struct vvp_object *vob = cl_inode2vvp(inode);
      
                  ENTRY;
                  LASSERT(vma->vm_file); <== 'vma->vm_file' is checked for NULL.
                  LASSERT(atomic_read(&vob->vob_mmap_cnt) >= 0);
                  atomic_inc(&vob->vob_mmap_cnt);
                  EXIT;
      }
      

      So, LASSERT(vma->vm_file) is useless because if it's NULL it will crash in file_inode(vma->vm_file).

      Attachments

        Activity

          People

            dmiter Dmitry Eremin (Inactive)
            dmiter Dmitry Eremin (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: