linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: mhocko@suse.com
Cc: linux-mm@kvack.org
Subject: [bug report] hugetlb, mempolicy: fix the mbind hugetlb migration
Date: Tue, 9 Jan 2018 23:05:39 +0300	[thread overview]
Message-ID: <20180109200539.g7chrnzftxyn3nom@mwanda> (raw)

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>

             reply	other threads:[~2018-01-09 20:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-09 20:05 Dan Carpenter [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180109200539.g7chrnzftxyn3nom@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox