Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3253822ybz; Mon, 27 Apr 2020 12:44:44 -0700 (PDT) X-Google-Smtp-Source: APiQypLgxC/VQdQ8fMSFm1Dk8n1eifZP7R48knptnPIBigS6Qa9taHOr4yBqMys1kxqHh9u7Ntj+ X-Received: by 2002:a17:906:35cd:: with SMTP id p13mr22151822ejb.206.1588016684024; Mon, 27 Apr 2020 12:44:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588016684; cv=none; d=google.com; s=arc-20160816; b=nzBkkm+bTdN5L6iBzXZanxfyMIFMflo8gUJFJhLFKV4gdTU70kobEgXph7Ut0f+T2+ ekDtApQ22N8ISSnUV/YXJBD4+JGPhJN7lxogcHu1E2OOA0ysM//HEKv5yxkDy4BVdZjY eb+XLSsYoFNrUEf1B+k4XHn/LvYSLkaZusYNiXf/ouTyOCIB5QS0GreumNy3kLX+ChPV XtPELA7bZhmV55kaHWMEM21j/H1QbxIalINeoP4t0Go9AKkDKalZWbk6Ds1Ic5XdfHE+ N6CKuQ2L/nVdz05dIE/bpVnWsVUSkVMAgcH65lJTKKUak1EFWLMFVNOKLw5pNgXua65A ZpHA== 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:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=7/P6O1zMXHW2csPFed/+nhXIIfGsciBZGW+Q1/D/LRo=; b=rNiGzM8/Vbdy2G2f2aF4Y8v/9lU7GYZ8zp3bftX7/Luuy22yUmzz1RPULzjHznHwQ1 od9dM/2QEIkIEQFCOz0S3lgRY9U1h/pxp4YEWB7MbryHDBz6chbYb12K792t2PAW8u56 OKOLbbGBAEpl6t4lNcrBjSoMjZzym7eq6lq96Ue/kPp8l17LcITaB+fZVXr+qrxxO1rX vxSLL64QyLuH/gw6Z8SgQQTaN6LnuZAz55aGEv4GUujstM0cvhQA9vh6lrST1x2eNnGL AU4zQRnkFOAkqaSCa6hr+HGCZ5aF5IYpNK/Z0z1IrE2Um7xmwOZxOgSvkiB+WogjPiH1 jxOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="BF4/l8Xr"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l30si411235edl.17.2020.04.27.12.44.20; Mon, 27 Apr 2020 12:44:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="BF4/l8Xr"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726788AbgD0Tmo (ORCPT + 99 others); Mon, 27 Apr 2020 15:42:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:51328 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726384AbgD0Tmm (ORCPT ); Mon, 27 Apr 2020 15:42:42 -0400 Received: from localhost.localdomain (c-73-231-172-41.hsd1.ca.comcast.net [73.231.172.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B71652078C; Mon, 27 Apr 2020 19:42:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588016562; bh=pHSFHwxnqBXxHCqPQAkxUYpCjZ/3lJQClrx+8qthDWQ=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=BF4/l8XrQ02299gpcli0FvwYPMF2hN3ZsowBym+oFxLCbmSBv6c8XKoMoCpSUs1mZ vLIh3Da+bxY+s/o+fJHms7WltoegzNJwopJah4TrVT7ox2ZS8JuHiDXeMfsgI8/UYZ lVmACC6y+QfktaRHOt+ND6M6DoBoUgRMxPoCw4LQ= Date: Mon, 27 Apr 2020 12:42:41 -0700 From: Andrew Morton To: Zong Li Cc: Will Deacon , linux-mm@kvack.org, "linux-kernel@vger.kernel.org List" , Paul Walmsley , Palmer Dabbelt , linux-riscv , tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, x86@kernel.org, hpa@zytor.com, catalin.marinas@arm.com, linux-arm-kernel Subject: Re: [PATCH 1/4] mm: add DEBUG_WX support Message-Id: <20200427124241.28adefc19cfddcf83f75d03c@linux-foundation.org> In-Reply-To: References: <23980cd0f0e5d79e24a92169116407c75bcc650d.1587455584.git.zong.li@sifive.com> <20200427074915.GA11787@willie-the-truck> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 27 Apr 2020 16:47:47 +0800 Zong Li wrote: > > > + This is useful for discovering cases where the kernel is leaving > > > + W+X mappings after applying NX, as such mappings are a security risk. > > > + This check also includes UXN, which should be set on all kernel > > > + mappings. > > > > "UXN" is the name of a bit in the arm64 page-table descriptors, so this > > should be reworded now that it's in generic help text. > > > > It's exactly. Sorry for missing the statement. > > Hi Andrew, > Shall I send a next version patch to fix it? It should be "This is > useful for discovering cases where the kernel is leaving W+X mappings > after applying NX, as such mappings are a security risk." here. I'll add this: --- a/mm/Kconfig.debug~mm-add-debug_wx-support-fix +++ a/mm/Kconfig.debug @@ -128,8 +128,8 @@ config DEBUG_WX help Generate a warning if any W+X mappings are found at boot. - This is useful for discovering cases where the kernel is leaving - W+X mappings after applying NX, as such mappings are a security risk. + This is useful for discovering cases where the kernel is leaving W+X + mappings after applying NX, as such mappings are a security risk. This check also includes UXN, which should be set on all kernel mappings. _