From: Jiri Slaby <jirislaby@kernel.org>
To: Pasha Tatashin <pasha.tatashin@soleen.com>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
linux-doc@vger.kernel.org, akpm@linux-foundation.org,
rientjes@google.com, pjt@google.com, weixugc@google.com,
gthelen@google.com, mingo@redhat.com, corbet@lwn.net,
will@kernel.org, rppt@kernel.org, keescook@chromium.org,
tglx@linutronix.de, peterz@infradead.org, masahiroy@kernel.org,
samitolvanen@google.com, dave.hansen@linux.intel.com,
x86@kernel.org, frederic@kernel.org, hpa@zytor.com,
aneesh.kumar@linux.ibm.com
Subject: Re: [PATCH 2/3] mm: page table check
Date: Wed, 1 Dec 2021 09:38:16 +0100 [thread overview]
Message-ID: <37511fa2-baed-c387-150c-3fa6b5b1c64f@kernel.org> (raw)
In-Reply-To: <20211123214814.3756047-3-pasha.tatashin@soleen.com>
On 23. 11. 21, 22:48, Pasha Tatashin wrote:
> Check user page table entries at the time they are added and removed.
>
> Allows to synchronously catch memory corruption issues related to
> double mapping.
>
> When a pte for an anonymous page is added into page table, we verify
> that this pte does not already point to a file backed page, and vice
> versa if this is a file backed page that is being added we verify that
> this page does not have an anonymous mapping
>
> We also enforce that read-only sharing for anonymous pages is allowed
> (i.e. cow after fork). All other sharing must be for file pages.
>
> Page table check allows to protect and debug cases where "struct page"
> metadata became corrupted for some reason. For example, when refcnt or
> mapcount become invalid.
>
> Signed-off-by: Pasha Tatashin <pasha.tatashin@soleen.com>
...
> --- a/mm/Kconfig.debug
> +++ b/mm/Kconfig.debug
> @@ -62,6 +62,30 @@ config PAGE_OWNER
>
> If unsure, say N.
>
> +config PAGE_TABLE_CHECK
> + bool "Check for invalid mappings in user page tables"
> + depends on ARCH_SUPPORTS_PAGE_TABLE_CHECK
> + select PAGE_EXTENSION
> + help
> + Check that anonymous page is not being mapped twice with read write
> + permissions. Check that anonymous and file pages are not being
> + erroneously shared. Since the checking is performed at the time
> + entries are added and removed to user page tables, leaking, corruption
> + and double mapping problems are detected synchronously.
> +
> + If unsure say "n".
> +
> +config PAGE_TABLE_CHECK_ENFORCED
> + bool "Enforce the page table checking by defauled"
s/defauled/default/
regards,
--
js
suse labs
next prev parent reply other threads:[~2021-12-01 8:38 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-23 21:48 [PATCH 0/3] " Pasha Tatashin
2021-11-23 21:48 ` [PATCH 1/3] mm: ptep_clear() page table helper Pasha Tatashin
2021-11-23 21:48 ` [PATCH 2/3] mm: page table check Pasha Tatashin
2021-11-27 8:10 ` Fusion Future
2021-11-27 8:14 ` Fushan Wen
2021-11-27 8:41 ` Fusion Future
2021-11-27 19:48 ` Pasha Tatashin
2021-11-28 8:13 ` Fusion Future
2021-11-28 9:37 ` Fusion
2021-11-28 16:54 ` Fusion Future
2021-11-28 16:57 ` Pasha Tatashin
2021-11-29 2:55 ` Fusion Future
2021-11-30 19:25 ` Pasha Tatashin
2021-12-01 8:38 ` Jiri Slaby [this message]
2021-11-23 21:48 ` [PATCH 3/3] x86: mm: add x86_64 support for " Pasha Tatashin
2021-12-01 8:00 ` Jiri Slaby
2021-12-01 8:44 ` Jiri Slaby
2021-12-01 13:55 ` Pasha Tatashin
2021-12-02 9:59 ` Jiri Slaby
2021-12-02 10:05 ` Jiri Slaby
2021-12-02 10:30 ` Muchun Song
2021-12-02 15:01 ` Pasha Tatashin
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=37511fa2-baed-c387-150c-3fa6b5b1c64f@kernel.org \
--to=jirislaby@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=aneesh.kumar@linux.ibm.com \
--cc=corbet@lwn.net \
--cc=dave.hansen@linux.intel.com \
--cc=frederic@kernel.org \
--cc=gthelen@google.com \
--cc=hpa@zytor.com \
--cc=keescook@chromium.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=masahiroy@kernel.org \
--cc=mingo@redhat.com \
--cc=pasha.tatashin@soleen.com \
--cc=peterz@infradead.org \
--cc=pjt@google.com \
--cc=rientjes@google.com \
--cc=rppt@kernel.org \
--cc=samitolvanen@google.com \
--cc=tglx@linutronix.de \
--cc=weixugc@google.com \
--cc=will@kernel.org \
--cc=x86@kernel.org \
/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