From nobody Mon Apr 6 03:13:12 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A5F34C6FA83 for ; Sun, 11 Sep 2022 10:00:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230095AbiIKKAC (ORCPT ); Sun, 11 Sep 2022 06:00:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229997AbiIKJ7j (ORCPT ); Sun, 11 Sep 2022 05:59:39 -0400 Received: from mail-qt1-x82b.google.com (mail-qt1-x82b.google.com [IPv6:2607:f8b0:4864:20::82b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B8E51150 for ; Sun, 11 Sep 2022 02:59:30 -0700 (PDT) Received: by mail-qt1-x82b.google.com with SMTP id cb8so4364451qtb.0 for ; Sun, 11 Sep 2022 02:59:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date; bh=OPh2SoeDJ39bM1Jn5fFI8VsUd8dRA2153uVq4iTm5YA=; b=Cm/iwBj9qSxR6hNh4WkGnlY2rIhzISZ52M2GqSDfU7xNlfLTD1kDBK3GW4JyIWLpbF vFCNPAJLgXJtsglJR9PAeKY44F6cjvaw6tuS4MXxA20nHmxmD/wqzebHgdbHMGmAD61N ZV4Tr5DVsNuioBerAQQDoJ4+a5mniKGiZRxoUQiZlNMllJ4sclh03nAFz08cVB8ODhMT Skx+FX/f8czauTMll515ktdu7gVSZJA1f7251v/yIj0BzYslEFQQtKX5F2MkHK/8CwmU Hx7spxOmVfuUwec09wkdbVsfFyOD1wVjfc69FUWeWsnCvU5bgK+iVzVBPk9GSB7Lao7h VxvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date; bh=OPh2SoeDJ39bM1Jn5fFI8VsUd8dRA2153uVq4iTm5YA=; b=kC7ZbpmxzSc7NBivbB4Pp3TUXZ0x12aLS2aiDKrdyhgSiTnXCpDGOGTLSUrwB45POq zG6c7LtN3X9itGrgloqs7VcUDml25/HhmlewPnOratRK5SivcFieOrIqSZ5YgKJJlTy5 GDC1LwlDReZx3ESrBjKMkeFsUyVnAO+eDOTWQv3CbBrPloDDUAY6xy6dNYa4rpceEGK1 AxZkx0SsrEzKrHrnL0RGlxoUlPaLMVcwZtV1cUz+JRAKK1KX0HlNVIh6oBtFloNz1yFP 30TzUAtWxE1O0p/YrMNI5hIiKTStsAoZyv1QIX1QaBaJsJ32VtmpzuCNn3KAwvJ8hPAF EU4A== X-Gm-Message-State: ACgBeo1zkHN1GR84iF2ClWsHScOPB4TQ1w5XVLMnlUIiqlqDNT/PDZiP dXEHIkxf8E6UIYqAxkm5dVtm1w== X-Google-Smtp-Source: AA6agR5J3Cn9HvOjdYaL72tcgWTBN3wcKIFFTOLz4o2e2o7b+hMrlixH3K7CPiJSXhwkuBn1HYdkSA== X-Received: by 2002:a05:622a:609:b0:35b:acd0:21ff with SMTP id z9-20020a05622a060900b0035bacd021ffmr3764909qta.321.1662890369441; Sun, 11 Sep 2022 02:59:29 -0700 (PDT) Received: from soleen.c.googlers.com.com (240.157.150.34.bc.googleusercontent.com. [34.150.157.240]) by smtp.gmail.com with ESMTPSA id y29-20020a37f61d000000b006cbd60c14c9sm4625233qkj.35.2022.09.11.02.59.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Sep 2022 02:59:28 -0700 (PDT) From: Pasha Tatashin To: pasha.tatashin@soleen.com, akpm@linux-foundation.org, corbet@lwn.net, linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, rick.p.edgecombe@intel.com Subject: [PATCH 1/3] mm/page_table_check: Check writable zero page in page table check Date: Sun, 11 Sep 2022 09:59:21 +0000 Message-Id: <20220911095923.3614387-2-pasha.tatashin@soleen.com> X-Mailer: git-send-email 2.37.2.789.g6183377224-goog In-Reply-To: <20220911095923.3614387-1-pasha.tatashin@soleen.com> References: <20220911095923.3614387-1-pasha.tatashin@soleen.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Rick Edgecombe The zero page should remain all zero, so that it can be mapped as read-only for read faults of memory that should be zeroed. If it is ever mapped writable to userspace, it could become non-zero and so other apps would unexpectedly get non-zero data. So the zero page should never be mapped writable to userspace. Check for this condition in page_table_check_set(). Signed-off-by: Rick Edgecombe Signed-off-by: Pasha Tatashin --- mm/page_table_check.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mm/page_table_check.c b/mm/page_table_check.c index e2062748791a..665ece0d55d4 100644 --- a/mm/page_table_check.c +++ b/mm/page_table_check.c @@ -102,6 +102,8 @@ static void page_table_check_set(struct mm_struct *mm, = unsigned long addr, if (!pfn_valid(pfn)) return; =20 + BUG_ON(is_zero_pfn(pfn) && rw); + page =3D pfn_to_page(pfn); page_ext =3D lookup_page_ext(page); anon =3D PageAnon(page); --=20 2.37.2.789.g6183377224-goog From nobody Mon Apr 6 03:13:12 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5529EECAAA1 for ; Sun, 11 Sep 2022 09:59:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230026AbiIKJ7r (ORCPT ); Sun, 11 Sep 2022 05:59:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229955AbiIKJ7i (ORCPT ); Sun, 11 Sep 2022 05:59:38 -0400 Received: from mail-qk1-x733.google.com (mail-qk1-x733.google.com [IPv6:2607:f8b0:4864:20::733]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D75C10E9 for ; Sun, 11 Sep 2022 02:59:31 -0700 (PDT) Received: by mail-qk1-x733.google.com with SMTP id g2so1388550qkk.1 for ; Sun, 11 Sep 2022 02:59:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date; bh=IQgFAlcZ+zBw786vdsFczK8VrNHApPya6ZC6RPMkUdg=; b=B7B7pHbZ63+sPWwS2bD6YT1SStvX81UMer7JZxmb2Y5zl//fOZKSJe6QQrlxj4unjc WDxlNFc81O6KKYWX+3kHXoCbwgrnTNTHrGPYF/Gy9N2yadEqTjxSGmHf6kXGCKYQSWsf i4szN97Ry6b/Sp93I9coUyReS67tuLpesPv72OwqzThS4Z7UjkNZaqZ+lGko554zcfcr jMbMa0KbUB9TSqD9EkFodoHDAkeUypmhY4mRkP+TAvo28yxDtecBCwbKDDLMp/eo7EFz g36jyaTCaEVtCX8w4/C+5f1Y+v4pabrpWeWxLiP4KAvAF6WYqDwwQIXjtUOrqRHZQlRZ r4RA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date; bh=IQgFAlcZ+zBw786vdsFczK8VrNHApPya6ZC6RPMkUdg=; b=wjG0KCfQ/bPSVvntImWY8WuUCWa5EQrgK1FAe9hbPDJrDYwdemiQRhybo1tWIw6yl7 R9L2R4rw1756bk7JtzHqLpQdol+5AGRX1w2Ac0i4gIWVAeiLX/6/BUV8v7Tzcw0j5i15 FtPZsxOovfiyI5xEuL+NzVkYTjShxZsBMpbx3d/jQM954Z59p7PF26ELA6p+/ODNcZwy CuheYHnmjMs1d6wlr3xbadFr5uhCLfkgr3ruS3Nqg95IcTOEbysfypvXVs4x2yQ0B9J2 cXkXQReaFujM1rURrxFOZhoZiwLGhy5OjSAPxBiaFDb+46vqd/4eLXJr0zgtS3H9FKxm Ex3Q== X-Gm-Message-State: ACgBeo1JGmAxJ1FUMBIFQMy9JwQ+0rFTX1R46Fk8IeHKmIbvlaHYK6rE E3hHekG0jzUC7qDRaUwAltvtFA== X-Google-Smtp-Source: AA6agR5DcmR8o9JAtmJ/2eIiSKRUYqewIiL/dNKxjys5qnEA0ST4IsGWy6xsrwjMK/lKCFbJNdD3zg== X-Received: by 2002:a05:620a:278d:b0:6bb:1435:c0bd with SMTP id g13-20020a05620a278d00b006bb1435c0bdmr15648933qkp.291.1662890370397; Sun, 11 Sep 2022 02:59:30 -0700 (PDT) Received: from soleen.c.googlers.com.com (240.157.150.34.bc.googleusercontent.com. [34.150.157.240]) by smtp.gmail.com with ESMTPSA id y29-20020a37f61d000000b006cbd60c14c9sm4625233qkj.35.2022.09.11.02.59.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Sep 2022 02:59:29 -0700 (PDT) From: Pasha Tatashin To: pasha.tatashin@soleen.com, akpm@linux-foundation.org, corbet@lwn.net, linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, rick.p.edgecombe@intel.com Subject: [PATCH 2/3] mm/page_table_check: Do WARN_ON instead of BUG_ON by default Date: Sun, 11 Sep 2022 09:59:22 +0000 Message-Id: <20220911095923.3614387-3-pasha.tatashin@soleen.com> X-Mailer: git-send-email 2.37.2.789.g6183377224-goog In-Reply-To: <20220911095923.3614387-1-pasha.tatashin@soleen.com> References: <20220911095923.3614387-1-pasha.tatashin@soleen.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Currently, page_table_check when detects errors panics kernel. Instead, print a warning, and panic only when specifically requested via kernel parameter: page_table_check=3Dpanic Signed-off-by: Pasha Tatashin --- mm/page_table_check.c | 53 +++++++++++++++++++++++++++++++------------ 1 file changed, 39 insertions(+), 14 deletions(-) diff --git a/mm/page_table_check.c b/mm/page_table_check.c index 665ece0d55d4..881f19d0714c 100644 --- a/mm/page_table_check.c +++ b/mm/page_table_check.c @@ -17,13 +17,37 @@ struct page_table_check { =20 static bool __page_table_check_enabled __initdata =3D IS_ENABLED(CONFIG_PAGE_TABLE_CHECK_ENFORCED); +static bool __page_table_check_panic; =20 DEFINE_STATIC_KEY_TRUE(page_table_check_disabled); EXPORT_SYMBOL(page_table_check_disabled); =20 +#define PAGE_TABLE_CHECK_BUG(v) \ + do { \ + bool __bug =3D !!(v); \ + \ + if (__page_table_check_panic) \ + BUG_ON(__bug); \ + else if (WARN_ON_ONCE(__bug)) \ + static_branch_enable(&page_table_check_disabled); \ + } while (false) + static int __init early_page_table_check_param(char *buf) { - return strtobool(buf, &__page_table_check_enabled); + int rc =3D strtobool(buf, &__page_table_check_enabled); + + if (rc) { + if (!strcmp(buf, "panic")) { + __page_table_check_enabled =3D true; + __page_table_check_panic =3D true; + rc =3D 0; + } + } + + if (rc) + pr_warn("Invalid option string: '%s'\n", buf); + + return rc; } =20 early_param("page_table_check", early_page_table_check_param); @@ -48,7 +72,8 @@ struct page_ext_operations page_table_check_ops =3D { =20 static struct page_table_check *get_page_table_check(struct page_ext *page= _ext) { - BUG_ON(!page_ext); + PAGE_TABLE_CHECK_BUG(!page_ext); + return (void *)(page_ext) + page_table_check_ops.offset; } =20 @@ -75,11 +100,11 @@ static void page_table_check_clear(struct mm_struct *m= m, unsigned long addr, struct page_table_check *ptc =3D get_page_table_check(page_ext); =20 if (anon) { - BUG_ON(atomic_read(&ptc->file_map_count)); - BUG_ON(atomic_dec_return(&ptc->anon_map_count) < 0); + PAGE_TABLE_CHECK_BUG(atomic_read(&ptc->file_map_count)); + PAGE_TABLE_CHECK_BUG(atomic_dec_return(&ptc->anon_map_count) < 0); } else { - BUG_ON(atomic_read(&ptc->anon_map_count)); - BUG_ON(atomic_dec_return(&ptc->file_map_count) < 0); + PAGE_TABLE_CHECK_BUG(atomic_read(&ptc->anon_map_count)); + PAGE_TABLE_CHECK_BUG(atomic_dec_return(&ptc->file_map_count) < 0); } page_ext =3D page_ext_next(page_ext); } @@ -102,7 +127,7 @@ static void page_table_check_set(struct mm_struct *mm, = unsigned long addr, if (!pfn_valid(pfn)) return; =20 - BUG_ON(is_zero_pfn(pfn) && rw); + PAGE_TABLE_CHECK_BUG(!is_zero_pfn(pfn) && rw); =20 page =3D pfn_to_page(pfn); page_ext =3D lookup_page_ext(page); @@ -112,11 +137,11 @@ static void page_table_check_set(struct mm_struct *mm= , unsigned long addr, struct page_table_check *ptc =3D get_page_table_check(page_ext); =20 if (anon) { - BUG_ON(atomic_read(&ptc->file_map_count)); - BUG_ON(atomic_inc_return(&ptc->anon_map_count) > 1 && rw); + PAGE_TABLE_CHECK_BUG(atomic_read(&ptc->file_map_count)); + PAGE_TABLE_CHECK_BUG(atomic_inc_return(&ptc->anon_map_count) > 1 && rw); } else { - BUG_ON(atomic_read(&ptc->anon_map_count)); - BUG_ON(atomic_inc_return(&ptc->file_map_count) < 0); + PAGE_TABLE_CHECK_BUG(atomic_read(&ptc->anon_map_count)); + PAGE_TABLE_CHECK_BUG(atomic_inc_return(&ptc->file_map_count) < 0); } page_ext =3D page_ext_next(page_ext); } @@ -131,12 +156,12 @@ void __page_table_check_zero(struct page *page, unsig= ned int order) struct page_ext *page_ext =3D lookup_page_ext(page); unsigned long i; =20 - BUG_ON(!page_ext); + PAGE_TABLE_CHECK_BUG(!page_ext); for (i =3D 0; i < (1ul << order); i++) { struct page_table_check *ptc =3D get_page_table_check(page_ext); =20 - BUG_ON(atomic_read(&ptc->anon_map_count)); - BUG_ON(atomic_read(&ptc->file_map_count)); + PAGE_TABLE_CHECK_BUG(atomic_read(&ptc->anon_map_count)); + PAGE_TABLE_CHECK_BUG(atomic_read(&ptc->file_map_count)); page_ext =3D page_ext_next(page_ext); } } --=20 2.37.2.789.g6183377224-goog From nobody Mon Apr 6 03:13:12 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0668DC6FA83 for ; Sun, 11 Sep 2022 10:00:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230020AbiIKJ74 (ORCPT ); Sun, 11 Sep 2022 05:59:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229979AbiIKJ7i (ORCPT ); Sun, 11 Sep 2022 05:59:38 -0400 Received: from mail-qt1-x831.google.com (mail-qt1-x831.google.com [IPv6:2607:f8b0:4864:20::831]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5DB131131 for ; Sun, 11 Sep 2022 02:59:32 -0700 (PDT) Received: by mail-qt1-x831.google.com with SMTP id h21so4339675qta.3 for ; Sun, 11 Sep 2022 02:59:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date; bh=XLM1m2iZcSFN7zEYtkuHYYcYmZjAkeATO8o3pAdAyoQ=; b=dK8IGsH1J6j5irLf37g7ieCD4ck/MOLB0cramE5RrrjgdpHHVF5mw5wd2s75b3a94l 2XA1exMylYG3mBaBY4drslL3G2Wr58g/tKZyaR96Rjny+antzG4vSdeJU2jjsZgJbOwh l1rarVtoxM8hJuVE4cMZGXQFYRc3sAcijxxs4gqKwGwmOjAgw2SLhZ4+S7KCauil99p5 lwRlQBl5+O38nc8RwZA0hjvs3NWijTbLtlasFVm0u2mY3vvH3iQsqjw6uxhf8vZkmj3U 6E5zxQdKtcdl1TOzLfLHVK9qZEpQFtXtJmdpxEwvF3ur9Pyt/REZjxQzTHQFILIPhjA9 IK1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date; bh=XLM1m2iZcSFN7zEYtkuHYYcYmZjAkeATO8o3pAdAyoQ=; b=MbWrHjzyWB4uXALVBqIOin/ukQ9x05rTKFrr8YoXUe0lX+bZ4JxJUKyZA7XZ82vV0O 8SsZz5C/BudQ2nWyUg8/rQlUTGDtpswuP56xhtvQExvuWTnGeACWnX6VFXVYME5XGkpJ EwwBRbNY94thzCAXbmerWGPrrHcb7thR05aaAJH1a0qVW/TBst6HFlLhclde9Ee+joD9 MpDPsirxT1A/8ZUqmNb7sPSFu6id8/uTUQQljU7TaD1NXXJ8OecS2U3ms/4sUuxDwo2F LPi0gjzP9zCv8Fq/G2RJTiGY8mSfURwQv6P15xJn8H4SbZ6kg9fdgJ26oPr5WIjXv4z6 BBXw== X-Gm-Message-State: ACgBeo3Bay5sIlCmrLsjmRpEvS4YemAkyJ2b/W3n+mZZ3hsNaR13DunS /Jr19ywwdPMgPLnh9JG9gnU+Cw== X-Google-Smtp-Source: AA6agR6jAmuFf2yJvMnDJ68B5wtvIomz7XM30r86b++gsxlkrxwEhuDJSX45o24EeDA83ZFIOnD1zQ== X-Received: by 2002:a05:622a:6027:b0:343:5691:93de with SMTP id he39-20020a05622a602700b00343569193demr19278780qtb.165.1662890371433; Sun, 11 Sep 2022 02:59:31 -0700 (PDT) Received: from soleen.c.googlers.com.com (240.157.150.34.bc.googleusercontent.com. [34.150.157.240]) by smtp.gmail.com with ESMTPSA id y29-20020a37f61d000000b006cbd60c14c9sm4625233qkj.35.2022.09.11.02.59.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Sep 2022 02:59:30 -0700 (PDT) From: Pasha Tatashin To: pasha.tatashin@soleen.com, akpm@linux-foundation.org, corbet@lwn.net, linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, rick.p.edgecombe@intel.com Subject: [PATCH 3/3] doc/vm: add information about page_table_check=panic Date: Sun, 11 Sep 2022 09:59:23 +0000 Message-Id: <20220911095923.3614387-4-pasha.tatashin@soleen.com> X-Mailer: git-send-email 2.37.2.789.g6183377224-goog In-Reply-To: <20220911095923.3614387-1-pasha.tatashin@soleen.com> References: <20220911095923.3614387-1-pasha.tatashin@soleen.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The default behavior of page table check was changed from panicking kernel to printing a warning. Add a note how to still panic the kernel when error is detected. Signed-off-by: Pasha Tatashin --- Documentation/mm/page_table_check.rst | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Documentation/mm/page_table_check.rst b/Documentation/mm/page_= table_check.rst index 1a09472f10a3..9306cd75647c 100644 --- a/Documentation/mm/page_table_check.rst +++ b/Documentation/mm/page_table_check.rst @@ -16,13 +16,13 @@ Page table check performs extra verifications at the ti= me when new pages become accessible from the userspace by getting their page table entries (PTEs PM= Ds etc.) added into the table. =20 -In case of detected corruption, the kernel is crashed. There is a small -performance and memory overhead associated with the page table check. Ther= efore, -it is disabled by default, but can be optionally enabled on systems where = the -extra hardening outweighs the performance costs. Also, because page table = check -is synchronous, it can help with debugging double map memory corruption is= sues, -by crashing kernel at the time wrong mapping occurs instead of later which= is -often the case with memory corruptions bugs. +In case of detected corruption, a warning is printed or kernel is crashed.= There +is a small performance and memory overhead associated with the page table = check. +Therefore, it is disabled by default, but can be optionally enabled on sys= tems +where the extra hardening outweighs the performance costs. Also, because p= age +table check is synchronous, it can help with debugging double map memory +corruption issues, by crashing kernel at the time wrong mapping occurs ins= tead +of later which is often the case with memory corruptions bugs. =20 Double mapping detection logic =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D @@ -52,5 +52,7 @@ Build kernel with: =20 - Boot with 'page_table_check=3Don' kernel parameter. =20 +- Boot with 'page_table_check=3Dpanic' in order to panic when error is det= ected. + Optionally, build kernel with PAGE_TABLE_CHECK_ENFORCED in order to have p= age table support without extra kernel parameter. --=20 2.37.2.789.g6183377224-goog