linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [bug report] hugetlb, mempolicy: fix the mbind hugetlb migration
@ 2018-01-09 20:05 Dan Carpenter
  2018-01-10 10:47 ` Michal Hocko
  0 siblings, 1 reply; 5+ messages in thread
From: Dan Carpenter @ 2018-01-09 20:05 UTC (permalink / raw)
  To: mhocko; +Cc: linux-mm

Hello Michal Hocko,

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

The patch ef2fc869a863: "hugetlb, mempolicy: fix the mbind hugetlb 
migration" from Jan 5, 2018, leads to the following Smatch complaint:

    mm/mempolicy.c:1100 new_page()
    error: we previously assumed 'vma' could be null (see line 1092)

mm/mempolicy.c
  1091		vma = find_vma(current->mm, start);
  1092		while (vma) {
                       ^^^
There is a check for NULL here

  1093			address = page_address_in_vma(page, vma);
  1094			if (address != -EFAULT)
  1095				break;
  1096			vma = vma->vm_next;
  1097		}
  1098	
  1099		if (PageHuge(page)) {
  1100			return alloc_huge_page_vma(vma, address);
                                                   ^^^
The patch adds a new unchecked dereference.  It might be OK?  I don't
know.

  1101		} else if (PageTransHuge(page)) {
  1102			struct page *thp;

regards,
dan carpenter

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-01-19  8:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-09 20:05 [bug report] hugetlb, mempolicy: fix the mbind hugetlb migration Dan Carpenter
2018-01-10 10:47 ` Michal Hocko
2018-01-17 12:18   ` Michal Hocko
2018-01-17 23:15     ` Naoya Horiguchi
2018-01-19  8:47       ` Michal Hocko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox