Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp100741ima; Tue, 23 Oct 2018 20:28:03 -0700 (PDT) X-Google-Smtp-Source: AJdET5c+SBcmo7i9HXbIFAKdSJSA2DkPwNBHmiK3afUJwbEaoOSs+i7c9lJxnEL/4L75TxWcDiaY X-Received: by 2002:a17:902:b08a:: with SMTP id p10-v6mr935187plr.26.1540351683316; Tue, 23 Oct 2018 20:28:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540351683; cv=none; d=google.com; s=arc-20160816; b=d/VvddcMjPZGvFOvP9hryI6xda+F7pheQ9/Og+zd3JOaxzVzsuHCTHhNN6eNRSmXGb vQO818Icy53PlP0Bex6Ff5mg2BOP9TuO9gUN+NY2inyYX3UiOMgbY3Ska9Lo4PD88lm2 W9/fh0ZWALpP+5F/aHHnxVrYCmPoO2nx+jwh4fUz11qTuYPrwcb1Y24hi2Osr2kD38ao ztNdqaPTH5dvyX+JM4M1v8Je6Jm4tUx5j9Yj2LY4VMYW2lsi6zf7qU6gMP2NaxQqfd28 Z26zM1wCc58xLpLE1beKIKfn+vtOXJw0RNyX0E99I6f7YTIaftW4xzFhfaHZeZMjj+8Y DvdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=zy2K2F53CAySisxVSbuPTYkyH7omh33CXz0Q8cfK5Bk=; b=LiS8tNYgX/uvofVf7tRJ6msls8cFsgsejWGVynbyGhX/ZpBoTtf/fFkvaNM6IozGfr a28Ghm7eEAGKQ/dTMy1ON7rXONBBuRf+8I+jlWaH8Ubk/xZITla9mKjrcoso/KEiR8in zTw3PJvTy6W3fec4aKTQRKRMTPd/YlWnlnrTRlvowMsigexfEF6vJPoXudxaurIccU1J nFIdIbOCyh3kkRWDWkwwngRUuJSCDVDgG+lM0K0flQeU/tMyjXCEpLXiFI2hbK4Ao4rx opLQtoEntEXz13hUQpossu6pH/Tk3HOxGM704bj69VguFbdGss7DKUf5bGGtmRuk6F1C Khfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=GBTmaOSK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a94-v6si3384402pla.123.2018.10.23.20.27.48; Tue, 23 Oct 2018 20:28:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=GBTmaOSK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726521AbeJXLx1 (ORCPT + 99 others); Wed, 24 Oct 2018 07:53:27 -0400 Received: from merlin.infradead.org ([205.233.59.134]:60690 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725896AbeJXLx1 (ORCPT ); Wed, 24 Oct 2018 07:53:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=zy2K2F53CAySisxVSbuPTYkyH7omh33CXz0Q8cfK5Bk=; b=GBTmaOSKz8/YDkvow2wdP5lv+h 8buucDgjgAYU08f2K7BLQApXv4+do+w7TpHWqZqucNnUuTzzcMdw+r1A0KuruvQrEqG/zLNP5sEs6 EFyc8DjtyH6R/WQ+6NLMHdXOejE8gC/4YXyhzQH56PY8fz4pHlAdZvSNJbdlBvUS8LSfuQh+fIQhR pXGWrw9/X7yEQSXZMx4ZBwI8Nfu33V7ZDptGUxno5x/X4tY/6l1N8bQzj+Dggt8/c+FK+9UlSrGpI U2b//WB32MtA/LBmpa7VzttDfNUonly5cZLUXRmJewazEbJvLPovGZXtpn0PymkfKXJTeGz4cBlOX MaV35JkA==; Received: from static-50-53-52-16.bvtn.or.frontiernet.net ([50.53.52.16] helo=midway.dunlab) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1gF9p7-0005cA-SN; Wed, 24 Oct 2018 03:27:10 +0000 Subject: Re: [PATCH 06/17] prmem: test cases for memory protection 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 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 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 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: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: 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