From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-it1-f198.google.com (mail-it1-f198.google.com [209.85.166.198]) by kanga.kvack.org (Postfix) with ESMTP id B5AAA6B7BA2 for ; Thu, 6 Dec 2018 14:23:33 -0500 (EST) Received: by mail-it1-f198.google.com with SMTP id o205so1918120itc.2 for ; Thu, 06 Dec 2018 11:23:33 -0800 (PST) Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id e11sor665269ioh.77.2018.12.06.11.23.32 for (Google Transport Security); Thu, 06 Dec 2018 11:23:32 -0800 (PST) MIME-Version: 1.0 References: <20181128000754.18056-1-rick.p.edgecombe@intel.com> <20181128000754.18056-2-rick.p.edgecombe@intel.com> <4883FED1-D0EC-41B0-A90F-1A697756D41D@gmail.com> <20181204160304.GB7195@arm.com> <51281e69a3722014f718a6840f43b2e6773eed90.camel@intel.com> <20181205114148.GA15160@arm.com> In-Reply-To: From: Ard Biesheuvel Date: Thu, 6 Dec 2018 20:23:20 +0100 Message-ID: Subject: Re: [PATCH 1/2] vmalloc: New flag for flush before releasing pages Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: owner-linux-mm@kvack.org List-ID: To: Andy Lutomirski Cc: Will Deacon , 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 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=E2=80=99s 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=E2=80=99t 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 hibe= rnate :-( > > 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.