[bug report] s390/mm: hugetlb pages within a gmap can not be freed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Dominik Dingel,

This is a semi-automatic email about new static checker warnings.

The patch 7d735b9ae82d: "s390/mm: hugetlb pages within a gmap can not 
be freed" from Jul 13, 2018, leads to the following Smatch complaint:

    arch/s390/mm/gmap.c:718 gmap_discard()
     error: we previously assumed 'vma' could be null (see line 715)

arch/s390/mm/gmap.c
   700          for (gaddr = from; gaddr < to;
   701               gaddr = (gaddr + PMD_SIZE) & PMD_MASK) {
   702                  /* Find the vm address for the guest address */
   703                  vmaddr = (unsigned long)
   704                          radix_tree_lookup(&gmap->guest_to_host,
   705                                            gaddr >> PMD_SHIFT);
   706                  if (!vmaddr)
   707                          continue;
   708                  vmaddr |= gaddr & ~PMD_MASK;
   709                  /* Find vma in the parent mm */
   710                  vma = find_vma(gmap->mm, vmaddr);
   711                  /*
   712                   * We do not discard pages that are backed by
   713                   * hugetlbfs, so we don't have to refault them.
   714			 */
   715			if (vma && is_vm_hugetlb_page(vma))
                            ^^^
The patch adds a new check

   716				continue;
   717			size = min(to - gaddr, PMD_SIZE - (gaddr & ~PMD_MASK));
   718			zap_page_range(vma, vmaddr, size);
                                       ^^^
but if "vma" is NULL we are toasted here anyway.

   719		}
   720		up_read(&gmap->mm->mmap_sem);

regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-s390" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux