Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp11100294imu; Thu, 6 Dec 2018 11:31:58 -0800 (PST) X-Google-Smtp-Source: AFSGD/XxoMBmx80iDtsW+hZbp3RyJuPQxwoYBHz/9o57mGO/PTZ9ndbsD465veFBI4iQUyMvF2IU X-Received: by 2002:a17:902:209:: with SMTP id 9mr29926293plc.288.1544124718847; Thu, 06 Dec 2018 11:31:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544124718; cv=none; d=google.com; s=arc-20160816; b=u0Fs+0dOPbar0IQCJa4A1QG6l+oWW66gf9QJ8iZqIIr8H5g5yz7qeHPCbqhA7434+M q02tT+ADEMMcrvlUWaFEeVgI9IzqdYCT03BxiWjXc6+RnqdKyP6RL0JPZ0TRFoRbpkAI tkQ/LZggDk+pE2YBKa0HtUPIR39jPOpfVxYE2Kxl2LTkEfI6wdfEKvt2iRI1cfNZ3NTX YAju+qtUgAm20PDEMTRHcW2P2j5Mvc7c50hk3Rtoa6WrDyN6nAYXSFq0i4VDHW6nDP/S SRIaFzQVAhgW8SRRAT/vxo1vuHXg11lLGhwzzVAQy9jTo1TxHhbwnKGRNTEDiKjNHCRa e3KQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=yHMymGjD9Fnn9VZB+LVIqukU2FJ6myZctMou9iRM2Oo=; b=jVnEA31JpfWrC6jkQ/x+HyNAg+HKM8oLG3gZsQ22prEfH1kn5rEsftR3DPlfsA4R2B bq8PECiGn1EYBpRJ3if4wUpTwjybAAsrm1zM7ONjtRxiggFtlDb0XhrULUdyoh+41QEJ IR95i8D1yeRM2HX5BVzOuEu72MZEAv2nZEHiuYl8idjYH9S+2sWhx0LzeB87+OYKus09 wrJEdVLd/CGcHMw5z0V+jgl9QMXqvzmhtmh8q4tzPNNlMoi06+BFOwcrAUjX4qqqtbBO SJ/GmB38TxChL/ON/5KC8elAGxcc7BkCW/EeKYHo+uLmNTCNVDF4QAm7MSTEuf5CFwjH 5ZQQ== 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 m188si949422pfb.266.2018.12.06.11.31.43; Thu, 06 Dec 2018 11:31:58 -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 S1726011AbeLFTas (ORCPT + 99 others); Thu, 6 Dec 2018 14:30:48 -0500 Received: from foss.arm.com ([217.140.101.70]:59396 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725986AbeLFTas (ORCPT ); Thu, 6 Dec 2018 14:30:48 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9E3961596; Thu, 6 Dec 2018 11:30:47 -0800 (PST) Received: from edgewater-inn.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 6C77C3F59C; Thu, 6 Dec 2018 11:30:47 -0800 (PST) Received: by edgewater-inn.cambridge.arm.com (Postfix, from userid 1000) id 8E0511AE0BAD; Thu, 6 Dec 2018 19:31:08 +0000 (GMT) Date: Thu, 6 Dec 2018 19:31:08 +0000 From: Will Deacon To: Ard Biesheuvel Cc: Andy Lutomirski , Rick Edgecombe , Nadav Amit , Linux Kernel Mailing List , Daniel Borkmann , Jessica Yu , Steven Rostedt , Alexei Starovoitov , Linux-MM , Jann Horn , "Dock, Deneen T" , Peter Zijlstra , kristen@linux.intel.com, Andrew Morton , Ingo Molnar , anil.s.keshavamurthy@intel.com, Kernel Hardening , Masami Hiramatsu , naveen.n.rao@linux.vnet.ibm.com, "David S. Miller" , "" , Dave Hansen Subject: Re: [PATCH 1/2] vmalloc: New flag for flush before releasing pages Message-ID: <20181206193108.GA21002@arm.com> References: <20181204160304.GB7195@arm.com> <51281e69a3722014f718a6840f43b2e6773eed90.camel@intel.com> <20181205114148.GA15160@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 06, 2018 at 08:23:20PM +0100, Ard Biesheuvel wrote: > On Thu, 6 Dec 2018 at 20:21, Andy Lutomirski wrote: > > > > On Thu, Dec 6, 2018 at 11:04 AM Ard Biesheuvel > > wrote: > > > > > > On Thu, 6 Dec 2018 at 19:54, Andy Lutomirski wrote: > > > > > > > > > > That’s not totally nuts. Do we ever have code that expects __va() to > > > > work on module data? Perhaps crypto code trying to encrypt static > > > > data because our APIs don’t understand virtual addresses. I guess if > > > > highmem is ever used for modules, then we should be fine. > > > > > > > > > > The crypto code shouldn't care, but I think it will probably break hibernate :-( > > > > How so? Hibernate works (or at least should work) on x86 PAE, where > > __va doesn't work on module data, and, on x86, the direct map has some > > RO parts with where the module is, so hibernate can't be writing to > > the memory through the direct map with its final permissions. > > On arm64 at least, hibernate reads the contents of memory via the > linear mapping. Not sure about other arches. Can we handle this like the DEBUG_PAGEALLOC case, and extract the pfn from the pte when we see that it's PROT_NONE? Will