From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 89046C433E0 for ; Thu, 21 May 2020 19:08:46 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4620820759 for ; Thu, 21 May 2020 19:08:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="aeZlVH+A" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4620820759 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E7C338000A; Thu, 21 May 2020 15:08:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E2B7380007; Thu, 21 May 2020 15:08:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D40AB8000A; Thu, 21 May 2020 15:08:45 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0219.hostedemail.com [216.40.44.219]) by kanga.kvack.org (Postfix) with ESMTP id BC29780007 for ; Thu, 21 May 2020 15:08:45 -0400 (EDT) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 7FB18181AEF1A for ; Thu, 21 May 2020 19:08:45 +0000 (UTC) X-FDA: 76841663010.16.feet79_1237c9baaca31 X-HE-Tag: feet79_1237c9baaca31 X-Filterd-Recvd-Size: 2937 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf42.hostedemail.com (Postfix) with ESMTP for ; Thu, 21 May 2020 19:08:45 +0000 (UTC) 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 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: 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.