From patchwork Sun Sep 11 09:59:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pasha Tatashin X-Patchwork-Id: 12972823 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C83BDECAAA1 for ; Sun, 11 Sep 2022 09:59:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D99F68000D; Sun, 11 Sep 2022 05:59:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D48BF80008; Sun, 11 Sep 2022 05:59:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B4CBA8000D; Sun, 11 Sep 2022 05:59:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 9CB8680008 for ; Sun, 11 Sep 2022 05:59:32 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 75B16C06F2 for ; Sun, 11 Sep 2022 09:59:32 +0000 (UTC) X-FDA: 79899357384.11.C9151B3 Received: from mail-qt1-f173.google.com (mail-qt1-f173.google.com [209.85.160.173]) by imf06.hostedemail.com (Postfix) with ESMTP id 2675618007F for ; Sun, 11 Sep 2022 09:59:32 +0000 (UTC) Received: by mail-qt1-f173.google.com with SMTP id w2so700704qtv.9 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=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=h4NB992USJ8pnBLvL853HICq+IFAKHVPtcdZRiTNq8u/B2X/x2b50USNZBSObByILZ VSPkLXo/LoZBkBUF2EeFTBJu55mJIx/TN5T5gB4FOJVhToR947zNPES3oocLl5BtEkZK zHoBzseZ0+A1c2BzwlB2GnBWE94VJYV3c6c0jk2lNrYAUOjSkA1ywvOWJOp+X9IhgvoD V26RjNOkAFCGxTHqUg0Pkr8YS/4ly/c9bXH8Cgt4Jw+9xEDipT5/yIIAO52I7pgd0G3Q COQad8/hWPyG2afy0a5g1f9yOIkHjzOjDTGZdJJMFZ6g9+OTGMNyVSs4QLtRLu+Fuo7i LR1A== X-Gm-Message-State: ACgBeo0KHO65iRAHvLz06RU5SlQVDl8BZ+Bo6FVUpY5xDyKqF+rxu9Nl xIThhPf9mL+/hS5yn/gUzMf8dQ== 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 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662890372; a=rsa-sha256; cv=none; b=Y4vk9r+gI15WxRvOfhHEtffDbBvYm+RR8vLuoV19Z+Sqcsrf7vkxL+eJWer1s3w6pCsEBi rqrHunIWLKOjOtovm1l62i9m8GzgDj4Rs8VHhWaC1mhNr904u+savBTgESo0FkRXPC57kU WQ8aYpVcgr52jzJSbde/OF683IpR+ho= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=soleen.com header.s=google header.b=dK8IGsH1; dmarc=none; spf=pass (imf06.hostedemail.com: domain of pasha.tatashin@soleen.com designates 209.85.160.173 as permitted sender) smtp.mailfrom=pasha.tatashin@soleen.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662890372; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=XLM1m2iZcSFN7zEYtkuHYYcYmZjAkeATO8o3pAdAyoQ=; b=DHNl9O3Iw64LebzgXHX/jOYd4MZu/XvOosMXfdens9h52I1AlYCT/DtC0SqDvIMP5tB4l9 HfCp1sNzqZ6yU/smmIE2nKlnPeLKr4TDCmowYhaYBNXyeM30/UVNBL6Z61T6BF9k8DCuni T3Vlqi1a4Z79asB+pDl5EnFbA+xKlJ4= X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 2675618007F Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=soleen.com header.s=google header.b=dK8IGsH1; dmarc=none; spf=pass (imf06.hostedemail.com: domain of pasha.tatashin@soleen.com designates 209.85.160.173 as permitted sender) smtp.mailfrom=pasha.tatashin@soleen.com X-Stat-Signature: rhsf7oirrjfoqmn8dcamztsfoxmef6jt X-Rspam-User: X-HE-Tag: 1662890371-10127 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 time when new pages become accessible from the userspace by getting their page table entries (PTEs PMDs etc.) added into the table. -In case of detected corruption, the 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 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 issues, -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 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 issues, by crashing kernel at the time wrong mapping occurs instead +of later which is often the case with memory corruptions bugs. Double mapping detection logic ============================== @@ -52,5 +52,7 @@ Build kernel with: - Boot with 'page_table_check=on' kernel parameter. +- Boot with 'page_table_check=panic' in order to panic when error is detected. + Optionally, build kernel with PAGE_TABLE_CHECK_ENFORCED in order to have page table support without extra kernel parameter.