Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1665569ybk; Thu, 21 May 2020 12:12:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwX/YX5x1H+nf6L4oVdojS2e1vClpKjpkqDUjZ5JmOk8BI5UwEV+BXi4z2TrT8RtPz+BXUS X-Received: by 2002:a50:c31a:: with SMTP id a26mr165672edb.384.1590088369109; Thu, 21 May 2020 12:12:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590088369; cv=none; d=google.com; s=arc-20160816; b=pmm4dO2gjxOAlQ+lPLqszgNB1QOAUHCZaitZyJUE5ZQe8Z3sQN41wkKvenJ5oOFIm+ WjhMWv34X5ULouo88tgKU1iFJdd7WvmuHPjXCZzmf26hj2hizuvgvFMloK32+4/Umhr9 UhRGRHoEy6tJ+jxnnh990NKnBYWedd1vHPieuCm5bCyCwerY33uvOmI9YUTXfMko/I/+ 1olUJo1F8TVKlE/FpNvNWLKuVS5pt5CSz71bJrp/pMlzLuYlrpN5NwFXiaKlGreE/eWS Gq05dzn/78gIzxC+GFM3g3qrYNNJmvp5/yvY4DlJaebDG9AUmZXGH1CR3Z3TZhRZO9uJ LzlQ== 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=HL/UHSnbobB/tMk8lX5mgAoCXeJi9aa6HHGu77ImgrI=; b=IebaF0CkKM0GmZYzFcv6h+OHxoA0IGPNxnGL/lJmTxlLFYtq/RrSgkHPx4Kce65abJ GnBmUiCZB4BYatYKgDzSgou58giGRHHjNHA0F9LoqOBCE/6g055EtX59mUoocIyr7Pwk Zd/K7qKwCI5E8j0X08x2LXiszRWf/t1JIkYxggu5kVuuzlaK5Iw06267cxfl0SOWIWbb mEg0iSL59kK4qLhViPISYTtxUZWLmTrr3+938SbxmvDvl+h1wqEfBuw12nP8j5SJDLlK fzE7IWOQGsRecdXFfO5o6jI9K+mDTnx6Oymj8hGGjXyrQkkFehpZyaIfn9aQc5NBtWD7 EKjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=aeZlVH+A; 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 do10si5112021ejc.671.2020.05.21.12.12.26; Thu, 21 May 2020 12:12:49 -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=aeZlVH+A; 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 S1730224AbgEUTIp (ORCPT + 99 others); Thu, 21 May 2020 15:08:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:52184 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729988AbgEUTIo (ORCPT ); Thu, 21 May 2020 15:08:44 -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 D7E0E20814; Thu, 21 May 2020 19:08:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590088124; bh=38ZxvCyni0IynWfLRxWlOV469xNPk/DOr/nCoCNx9Zw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=aeZlVH+AhFDetfD9NqlUROeK9xxXibQIhbI3iwRwc1OhLgVgQByrGI+wUry8QFla1 2h2veWD7JLxXV3wpAO0FhxRUCRFWF1otmCjXTsWUqQxE//E45+KtKQku73ZBSzVrbi 65SxNcUGWTeMDmVX4Gv8uRX9qHuwBYbpEnhMXOw4= Date: Thu, 21 May 2020 12:08:43 -0700 From: Andrew Morton To: Steven Price Cc: Andy Lutomirski , Borislav Petkov , Dave Hansen , Ingo Molnar , Peter Zijlstra , Thomas Gleixner , x86@kernel.org, Jan Beulich , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH 0/2] Fix W+X debug feature on x86 Message-Id: <20200521120843.427b7ff33f8ed7f824eb07f9@linux-foundation.org> In-Reply-To: <20200521152308.33096-1-steven.price@arm.com> References: <20200521152308.33096-1-steven.price@arm.com> 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 Thu, 21 May 2020 16:23:06 +0100 Steven Price wrote: > Jan alert me[1] that the W+X detection debug feature was broken in x86 > by my change[2] to switch x86 to use the generic ptdump infrastructure. > > Fundamentally the approach of trying to move the calculation of > effective permissions into note_page() was broken because note_page() is > only called for 'leaf' entries and the effective permissions are passed > down via the internal nodes of the page tree. The solution I've taken > here is to create a new (optional) callback which is called for all > nodes of the page tree and therefore can calculate the effective > permissions. > > Secondly on some configurations (32 bit with PAE) "unsigned long" is not > large enough to store the table entries. The fix here is simple - let's > just use a u64. I assumed that a cc:stable was appropriate on both of these(?). > I'd welcome testing (and other comments), especially if you have a > configuration which previously triggered W+X warnings as I don't have > such a setup. I'll wait a while for such testing. If nothing happens then I guess we merge it up and see what then happens.