From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io1-f69.google.com (mail-io1-f69.google.com [209.85.166.69]) by kanga.kvack.org (Postfix) with ESMTP id 25C8E6B0007 for ; Tue, 23 Oct 2018 23:27:25 -0400 (EDT) Received: by mail-io1-f69.google.com with SMTP id c5-v6so2949234ioa.0 for ; Tue, 23 Oct 2018 20:27:25 -0700 (PDT) Received: from merlin.infradead.org (merlin.infradead.org. [2001:8b0:10b:1231::1]) by mx.google.com with ESMTPS id y140-v6si1593573iof.56.2018.10.23.20.27.20 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Oct 2018 20:27:20 -0700 (PDT) Subject: Re: [PATCH 06/17] prmem: test cases for memory protection References: <20181023213504.28905-1-igor.stoppa@huawei.com> <20181023213504.28905-7-igor.stoppa@huawei.com> From: Randy Dunlap Message-ID: Date: Tue, 23 Oct 2018 20:27:06 -0700 MIME-Version: 1.0 In-Reply-To: <20181023213504.28905-7-igor.stoppa@huawei.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Igor Stoppa , Mimi Zohar , Kees Cook , Matthew Wilcox , Dave Chinner , James Morris , Michal Hocko , kernel-hardening@lists.openwall.com, linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org Cc: igor.stoppa@huawei.com, Dave Hansen , Jonathan Corbet , Laura Abbott , Vlastimil Babka , "Kirill A. Shutemov" , Andrew Morton , Pavel Tatashin , linux-mm@kvack.org, linux-kernel@vger.kernel.org On 10/23/18 2:34 PM, Igor Stoppa wrote: > diff --git a/mm/Kconfig.debug b/mm/Kconfig.debug > index 9a7b8b049d04..57de5b3c0bae 100644 > --- a/mm/Kconfig.debug > +++ b/mm/Kconfig.debug > @@ -94,3 +94,12 @@ config DEBUG_RODATA_TEST > depends on STRICT_KERNEL_RWX > ---help--- > This option enables a testcase for the setting rodata read-only. > + > +config DEBUG_PRMEM_TEST > + tristate "Run self test for protected memory" > + depends on STRICT_KERNEL_RWX > + select PRMEM > + default n > + help > + Tries to verify that the memory protection works correctly and that > + the memory is effectively protected. Hi, a. It seems backwards (or upside down) to have a test case select a feature (PRMEM) instead of depending on that feature. b. Since PRMEM depends on MMU (in patch 04/17), the "select" here could try to enabled PRMEM even when MMU is not enabled. Changing this to "depends on PRMEM" would solve both of these issues. c. Don't use "default n". That is already the default. thanks, -- ~Randy