linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [bug report] mm/hugetlb: possible data leak with huge pmd sharing
@ 2022-07-25  9:07 Miaohe Lin
  2022-07-25 18:35 ` Mike Kravetz
  0 siblings, 1 reply; 5+ messages in thread
From: Miaohe Lin @ 2022-07-25  9:07 UTC (permalink / raw)
  To: Linux-MM, linux-kernel; +Cc: Andrew Morton, Mike Kravetz, Muchun Song

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! :)


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

end of thread, other threads:[~2022-07-27  1:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-25  9:07 [bug report] mm/hugetlb: possible data leak with huge pmd sharing Miaohe Lin
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

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