linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Miaohe Lin <linmiaohe@huawei.com>
To: Linux-MM <linux-mm@kvack.org>,
	linux-kernel <linux-kernel@vger.kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Mike Kravetz <mike.kravetz@oracle.com>,
	Muchun Song <songmuchun@bytedance.com>
Subject: [bug report] mm/hugetlb: possible data leak with huge pmd sharing
Date: Mon, 25 Jul 2022 17:07:54 +0800	[thread overview]
Message-ID: <025b3ea6-4b26-f091-5464-0eef5aac7719@huawei.com> (raw)

Hi all:
    When I investigate the mm/hugetlb code, I found there's a possible data leak issue
with huge pmd sharing. Thank about the below scene:

    1. Process A and process B shares huge pmd page.(vm_flags: VM_MAYSHARE but !VM_SHARED)
    2. Process A write fault a hugetlb page. As vm_flags is !VM_SHARED, a private copy of
hugetlb page will be installed in the pagetable via hugetlb_wp.
    3. Process A writes private data into hugetlb page.
    4. Process B can read process A's private data since hugetlb page is shared through huge
pmd sharing...

I think the above scene is possible. If so, huge pmd sharing for !VM_SHARED should be disabled
to fix this issue? Or am I miss something about hugetlb huge pmd sharing?

Any response would be appreciated.

Thanks! :)


             reply	other threads:[~2022-07-25  9:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-25  9:07 Miaohe Lin [this message]
2022-07-25 18:35 ` Mike Kravetz
2022-07-26  7:14   ` Miaohe Lin
2022-07-26 17:18     ` Mike Kravetz
2022-07-27  1:49       ` Miaohe Lin

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=025b3ea6-4b26-f091-5464-0eef5aac7719@huawei.com \
    --to=linmiaohe@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mike.kravetz@oracle.com \
    --cc=songmuchun@bytedance.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