Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp11093786imu; Thu, 6 Dec 2018 11:24:57 -0800 (PST) X-Google-Smtp-Source: AFSGD/WM/EPpFVdzn3he5TXGv0tcZVF2UXUD/gz+fRUBhZVR4/Rs1hvs/fZUL3KDrODquRMlB+2t X-Received: by 2002:a17:902:1005:: with SMTP id b5mr29646741pla.310.1544124297146; Thu, 06 Dec 2018 11:24:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544124297; cv=none; d=google.com; s=arc-20160816; b=uolLoptVnq3CHE44gKkGT3VFVLGS0sqgVqv36PduHChe2KR0Wu2at6x4qraRABhZaB nOiWEkRhDdWzP+zploGjO5KLWQ+ExhRcEvz/Z2Za3ZV1r0fS+O9MdFOQIGrI7lXDp3sj pZ00C/AtADnndls9Iah9naXIUvcVViC5GoOOwUf7YoaB7jI1fubyVcZUQfueh3xIPpXK /mPptNf9d7jxZqeWXZ/tQQYCZxb/60dmMxowEqMOPccoQFaw9D8CiU0rBN8OzQa4aVG5 j/Mosa6vVWW+TCrt8LJo6UPy2PFFrxSUsFVdJh1FfAbiABy/goMmXngv3HUdmaxusPl5 JQ3w== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=AuQHmkflHUXBiQLptcaBPw7KGurSXS2ND8rkREtR754=; b=wn5vtsHlSao4YcBGEngJo9k7CUv8Jj+dctT9cdQONkCiVF25C+uKcKpoaqHIUOflkt Rd5NDVnXOZIwGWvoNcfk3EQTiZfW6rK8ASb9L+LgWroY51v1TXqYcdM/R4UnK9hUnDKk A9QFsTk9N7jCdvm+Og8Le5UQRVNzZcMePz2+USzW9kfSd6oSbMK6hris/hsdFWM8CmgL gEBDIWi4UrKY9fgH+DBFaQdH15K3U8tBZxtUo0jDntAtyFuZzhpWJ8gO5qIQ+OS55Q9t wyi+mTWsK7N6+bYgGW2ngyBEVidBR0D4dgG75zMayblWqfVGRLQCIWpKzy/wI4MSLE2B 0Z5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CqJ+TXVY; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b5si909395pfg.121.2018.12.06.11.24.42; Thu, 06 Dec 2018 11:24:57 -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; dkim=pass header.i=@linaro.org header.s=google header.b=CqJ+TXVY; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726272AbeLFTXe (ORCPT + 99 others); Thu, 6 Dec 2018 14:23:34 -0500 Received: from mail-io1-f65.google.com ([209.85.166.65]:43002 "EHLO mail-io1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726257AbeLFTXd (ORCPT ); Thu, 6 Dec 2018 14:23:33 -0500 Received: by mail-io1-f65.google.com with SMTP id x6so1278465ioa.9 for ; Thu, 06 Dec 2018 11:23:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=AuQHmkflHUXBiQLptcaBPw7KGurSXS2ND8rkREtR754=; b=CqJ+TXVYSgaeVJbTrmmnh37zS5SOkAn73llCPRZJ8OKeoG95r/51LJ2PFtjBCUGlsy d+O0Sb2BI2rV1dvnTcJ8BC9CYuGZq7T2cGprG6kEQ19YtzcDblUKM+mW4wr4qLzCCNYi 4MwnQ8XVUSt6Bh7HB3WsYhF/ITQFDxBs3uQco= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=AuQHmkflHUXBiQLptcaBPw7KGurSXS2ND8rkREtR754=; b=QsS1onwhlepv7E1dr0w439tJTdIAgk3rawuHX7HDwYfdKAsP1ZHcBR/R47UvUpH+ci btymGygLcCX1LQO7YvEiHjhFviyEJd2TLXL6QnFEfdbwaTA/tbQyv04/SikcXun9fuWh 8yA+OM8ywvsTm5qViQci3cFsOQwDHCXddBO3M/9HhNwYgdQMoik1yHwlr9YPCIQ/WiFz 2euetty/3CAhTph1CiSoDESHmrfgXqBykESgcansEq0ajhgm85SWD1N8spE/a4n7kBxR m/Tpok27idQUpwIaHBUXq0AYQU7EwhQmuTWl4KV+InKWZ+1eLkxVXQ8TCsoWTDjqfNVm LEag== X-Gm-Message-State: AA+aEWZyc+b4bHiXRbOHDfzvEiZfWT0nkAvovIaJMzKf9VpGvpvONHd2 7kB+FXy4g6PzFlO+630C02Y/zHYD/HwWDz7jZiTsvA== X-Received: by 2002:a6b:5d01:: with SMTP id r1mr24087141iob.170.1544124212172; 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 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.