Received: by 10.223.164.202 with SMTP id h10csp342481wrb; Wed, 15 Nov 2017 00:14:32 -0800 (PST) X-Google-Smtp-Source: AGs4zMa9nZ2UWGAaEbHVxbDg5oX6qXlbv0JRWOLpwDgWOv3vnMiQQOQSDkzwS1iqRedgwAWJq0eY X-Received: by 10.84.129.228 with SMTP id b91mr14868890plb.56.1510733672193; Wed, 15 Nov 2017 00:14:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510733672; cv=none; d=google.com; s=arc-20160816; b=Gmr/BAf+NR0jIy3NFYqs2SYosjZLcx2U/fb8NSCjM0kG7gu9leoXE4HPmtGD9dyfRA Yckhy7AUEz5+2crKF5wW1zi2XB62iHs2fgK9YURdyagKVwTtQMmGdQAXCrPbJcoyN94S Hlr8wklAtu8KhtMNs7zDyj03ali8A//8PqaDHT8PKdayb1qJkJEezTTKPZRIZmgf7Flp 5UH2xgPyvTGHqm+2WBtG4DhzhVWI4Hcovx3yn4M3w2rCmapTZ7jWB+rNpEzL2SG36AZ8 CP4IlzQDkrYjFNYaagyUqh3zM70cdpGvVsJbHV9/FXDiRtzdRe97gq/VdBsfmV2WaEiT gnJQ== 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:cc:references:to:subject:arc-authentication-results; bh=+M3lwf+dukz/GFeJGyKi4z3fxAmvjemgnn3QZIPQFQ4=; b=06bIUvhIF3tj5TITFlhTcHaqNVmnNJPBkdmPr7IUqALEydrxzoMkSJ9PQEPL+7xwtw dzVKv+Y9h0NkWsUiVMeU5wlbtVI+oxyPb60RwzJVGcgcdFwscnn0kgpFi0lTaxmD1yfk JQPGDl+lmpnZlQkfGOi1QyQe0jpngF+4bDPEJix/hibHUh02UHQuKSESwccEmsDvgoXk /079uehQjnY89D3/z3pa9ZlsulnBwxLe5wVt8zujFGzYnh/RlMNHBq2//Y/CbNPxY41y eCP00Ca5/Vm/695Pi3xXRjRmTU1EelmDvqmxRly8qbEKhXZrjlj9GFVyr/jn4/OnNwdp ZOQQ== ARC-Authentication-Results: i=1; mx.google.com; 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 g27si11766655pgn.58.2017.11.15.00.14.19; Wed, 15 Nov 2017 00:14:32 -0800 (PST) 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; 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 S1755360AbdKOHA3 (ORCPT + 88 others); Wed, 15 Nov 2017 02:00:29 -0500 Received: from mga01.intel.com ([192.55.52.88]:37154 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755194AbdKOHAV (ORCPT ); Wed, 15 Nov 2017 02:00:21 -0500 Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Nov 2017 23:00:21 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,398,1505804400"; d="scan'208";a="149643916" Received: from tbbowns-mobl.amr.corp.intel.com (HELO [10.254.116.194]) ([10.254.116.194]) by orsmga004.jf.intel.com with ESMTP; 14 Nov 2017 23:00:21 -0800 Subject: Re: [PATCH v6 03/11] mm, x86: Add support for eXclusive Page Frame Ownership (XPFO) To: Matthew Wilcox References: <20170907173609.22696-1-tycho@docker.com> <20170907173609.22696-4-tycho@docker.com> <34454a32-72c2-c62e-546c-1837e05327e1@intel.com> <20170920223452.vam3egenc533rcta@smitten> <97475308-1f3d-ea91-5647-39231f3b40e5@intel.com> <20170921000901.v7zo4g5edhqqfabm@docker> <20171110010907.qfkqhrbtdkt5y3hy@smitten> <7237ae6d-f8aa-085e-c144-9ed5583ec06b@intel.com> <2aa64bf6-fead-08cc-f4fe-bd353008ca59@intel.com> <20171115034430.GA24257@bombadil.infradead.org> Cc: Tycho Andersen , linux-kernel@vger.kernel.org, linux-mm@kvack.org, kernel-hardening@lists.openwall.com, Marco Benatto , Juerg Haefliger , x86@kernel.org From: Dave Hansen Message-ID: Date: Tue, 14 Nov 2017 23:00:20 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171115034430.GA24257@bombadil.infradead.org> 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 11/14/2017 07:44 PM, Matthew Wilcox wrote: > On Mon, Nov 13, 2017 at 02:46:25PM -0800, Dave Hansen wrote: >> On 11/13/2017 02:20 PM, Dave Hansen wrote: >>> On 11/09/2017 05:09 PM, Tycho Andersen wrote: >>>> which I guess is from the additional flags in grow_dev_page() somewhere down >>>> the stack. Anyway... it seems this is a kernel allocation that's using >>>> MIGRATE_MOVABLE, so perhaps we need some more fine tuned heuristic than just >>>> all MOVABLE allocations are un-mapped via xpfo, and all the others are mapped. >>>> >>>> Do you have any ideas? >>> >>> It still has to do a kmap() or kmap_atomic() to be able to access it. I >>> thought you hooked into that. Why isn't that path getting hit for these? >> >> Oh, this looks to be accessing data mapped by a buffer_head. It >> (rudely) accesses data via: >> >> void set_bh_page(struct buffer_head *bh, >> ... >> bh->b_data = page_address(page) + offset; > > We don't need to kmap in order to access MOVABLE allocations. kmap is > only needed for HIGHMEM allocations. So there's nothing wrong with ext4 > or set_bh_page(). Yeah, it's definitely not _buggy_. Although, I do wonder what we should do about these for XPFO. Should we just stick a kmap() in there and comment it? What we really need is a mechanism to say "use this as a kernel page" and "stop using this as a kernel page". kmap() does that... kinda. It's not a perfect fit, but it's pretty close. From 1584110338343607794@xxx Wed Nov 15 05:55:44 +0000 2017 X-GM-THRID: 1577903505730930323 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread