[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <172f894c-01ab-cd9f-3292-1ba811f7222a@kernel.org>
Date: Thu, 2 Dec 2021 11:05:47 +0100
From: Jiri Slaby <jirislaby@...nel.org>
To: Pasha Tatashin <pasha.tatashin@...een.com>
Cc: LKML <linux-kernel@...r.kernel.org>, linux-mm <linux-mm@...ck.org>,
Linux Doc Mailing List <linux-doc@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
David Rientjes <rientjes@...gle.com>,
Paul Turner <pjt@...gle.com>, weixugc@...gle.com,
Greg Thelen <gthelen@...gle.com>,
Ingo Molnar <mingo@...hat.com>,
Jonathan Corbet <corbet@....net>,
Will Deacon <will@...nel.org>, Mike Rapoport <rppt@...nel.org>,
Kees Cook <keescook@...omium.org>,
Thomas Gleixner <tglx@...utronix.de>,
Peter Zijlstra <peterz@...radead.org>, masahiroy@...nel.org,
Sami Tolvanen <samitolvanen@...gle.com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
"maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" <x86@...nel.org>,
frederic@...nel.org, "H. Peter Anvin" <hpa@...or.com>,
"Aneesh Kumar K.V" <aneesh.kumar@...ux.ibm.com>
Subject: Re: [PATCH 3/3] x86: mm: add x86_64 support for page table check
On 02. 12. 21, 10:59, Jiri Slaby wrote:
> On 01. 12. 21, 14:55, Pasha Tatashin wrote:
>> On Wed, Dec 1, 2021 at 3:44 AM Jiri Slaby <jirislaby@...nel.org> wrote:
>>>
>>> On 01. 12. 21, 9:00, Jiri Slaby wrote:
>>>> On 23. 11. 21, 22:48, Pasha Tatashin wrote:
>>>>> Add page table check hooks into routines that modify user page tables.
>>>>
>>>> Hi,
>>>>
>>>> I bisected to this as this causes crashes during modules load:
>>>
>>> And it's not enough to unset CONFIG_PAGE_TABLE_CHECK_ENFORCED. I had to
>>> unset CONFIG_PAGE_TABLE_CHECK completely to get rid of this.
>>
>> Hi,
>>
>> Thanks for reporting this. Seems like module load for some reasons
>> does not like the static branches. However, I was not able to repro
>> this. Could you please share your config and the module that you were
>> loading?
>
> It's the openSUSE's -next config:
> https://raw.githubusercontent.com/openSUSE/kernel-source/linux-next/config/x86_64/vanilla
>
>
> But with CONFIG_IWLMEI=n (as that fails to link).
>
> One has to load i915, other modules (71 on my system) are apparently fine.
>
> i915 tries to patch your `page_table_check_disabled' which is defined as
> `DEFINE_STATIC_KEY_TRUE_RO':
> > jump_label_add_module: key=__tracepoint_mmap_lock_released
> (ffffffff93f36d88) mod=0000000000000000
> > jump_label_add_module: key=hugetlb_free_vmemmap_enabled_key
> (ffffffff94873560) mod=0000000000000000
> > jump_label_add_module: key=devmap_managed_key (ffffffff94902700)
> mod=0000000000000000
> > jump_label_add_module: key=page_table_check_disabled
> (ffffffff939da760) mod=0000000000000000
> > BUG: unable to handle page fault for address: ffffffff939da768
Provided you EXPORT page_table_check_disabled and it can be used from
modules, it can be barely marked as RO. So the below indeed fixes the
problem for me:
--- a/mm/page_table_check.c
+++ b/mm/page_table_check.c
@@ -18,7 +18,7 @@ struct page_table_check {
static bool __page_table_check_enabled __initdata =
IS_ENABLED(CONFIG_PAGE_TABLE_CHECK_ENFORCED);
-DEFINE_STATIC_KEY_TRUE_RO(page_table_check_disabled);
+DEFINE_STATIC_KEY_TRUE(page_table_check_disabled);
EXPORT_SYMBOL(page_table_check_disabled);
static int __init early_page_table_check_param(char *buf)
>
> regards,
--
js
suse labs
Powered by blists - more mailing lists