Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp509824imm; Tue, 15 May 2018 05:10:22 -0700 (PDT) X-Google-Smtp-Source: AB8JxZojnXy4vR6hZkxoHrsCJy1vZUQKGRzQ6g8DGdgcJY6FJ2USrh/g6q1+ikbpKlWxsJ1KuqmO X-Received: by 2002:a62:ae13:: with SMTP id q19-v6mr14870084pff.155.1526386222237; Tue, 15 May 2018 05:10:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526386222; cv=none; d=google.com; s=arc-20160816; b=v/27Y0VOW1VU2JauQo9sk4cP4a9brM633SUfNhIxFqS4yDn0xiAIv6/wVjhgPjk9zw NXDlDEoUFKlLrHkYmy/WVNNQ7RGtReiY2iYeLKWU1L0+pKteI5vt7Qw6hoFpUtfN9aLS rgbMtRk5ICrii49OA/pVfLVpqd7+gKS/THh34UsBu73mtEopCY474kqNX7vHifv03c4R 3rwzPRLXx1gDHofDq2DXL7hVe9MK7a/XoYT0g0X0hjXET+2/SgKM6VDW0ntWMCDql6hO 4B2JWPxB1tP5AJnWN/dDu/WXX3ZCvmrp/i8FofGjI/xvowE2UClEpaDSYsuL5k9z0LcR xM/g== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=IPflZbCG5tMZwQXmqerlR009N2C5RJaudvJL3at9d18=; b=LZ+EfbAWrIsDVoOMNd7UOTxl/vxTnTa3aLvhjmzQzdxNDGUyTwf99hIj14UM68tUlm BmkbX9iBGdmHX7z2h0jNGe+cRZMFTYLkZql3mI58PV6CCL4tW5I6WIu3zSlYvr8PjeHS OHIhE5oWtcGdpWREanYY4kTK8Oysctc9Nv5RSnRqdm5yEUxEEbPKJfWmlbGZJbG4CDAd k+TeyCKhIx8fffjLkAc0UAGxpcAsVqX51ldLpFRCWGp+2CPgPH5sOgC2TFXBtfV/NIvj 0ueCpJC8Q7ifs6y64vHHowS4j8HP8CkZGk301imRkXvv+GE4Gg1uysKDX7z9y/5nqt8n PMTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=tMQm8xfb; 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 h13-v6si8977515pgq.138.2018.05.15.05.10.03; Tue, 15 May 2018 05:10:22 -0700 (PDT) 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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=tMQm8xfb; 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 S1753167AbeEOMJr (ORCPT + 99 others); Tue, 15 May 2018 08:09:47 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:34682 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753121AbeEOMJq (ORCPT ); Tue, 15 May 2018 08:09:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=IPflZbCG5tMZwQXmqerlR009N2C5RJaudvJL3at9d18=; b=tMQm8xfbmqK6XEE3/+uGNb4ns 8lBmjCIbbDrYv3HPRZ8Tsr8VCPNfZCi3rmZgQQHssIGy4jQZk96MfV++O1ghQs+gICROPdg/bMabP MlMpC9xdvSfnTUP3mB248J/EyB6xKG7JdKqxuJdYPRhCp3umvl/P/krnRY+hHyumX0770TC9DCTR2 gkI5iTInTw6cVUbN+Dqc/4O9KjriVP8uHyMWgavBRKMyNJypmbGEFGvCk44N3INvuvnaph65rklmr ckvcWcXvt6wLdrHUlET+7qfGjuEtXy10m/qJxwehx1DVQeibcyBi4UNSqp/9SoXnyIFHVyW2QE/BZ vDYGXVkrA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fIYlw-000327-Qq; Tue, 15 May 2018 12:09:40 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 214AB2029F86C; Tue, 15 May 2018 14:09:39 +0200 (CEST) Date: Tue, 15 May 2018 14:09:39 +0200 From: Peter Zijlstra To: Boaz Harrosh Cc: Matthew Wilcox , Jeff Moyer , Andrew Morton , "Kirill A. Shutemov" , linux-kernel , linux-fsdevel , "linux-mm@kvack.org" , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, Dave Hansen , Rik van Riel , Jan Kara , Matthew Wilcox , Amit Golander Subject: Re: [PATCH] mm: Add new vma flag VM_LOCAL_CPU Message-ID: <20180515120939.GA12217@hirez.programming.kicks-ass.net> References: <0efb5547-9250-6b6c-fe8e-cf4f44aaa5eb@netapp.com> <20180514191551.GA27939@bombadil.infradead.org> <7ec6fa37-8529-183d-d467-df3642bcbfd2@netapp.com> <20180515004137.GA5168@bombadil.infradead.org> <20180515111159.GA31599@bombadil.infradead.org> <6999e635-e804-99d0-12fc-c13ff3e9ca58@netapp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6999e635-e804-99d0-12fc-c13ff3e9ca58@netapp.com> User-Agent: Mutt/1.9.5 (2018-04-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 15, 2018 at 02:41:41PM +0300, Boaz Harrosh wrote: > On 15/05/18 14:11, Matthew Wilcox wrote: > > You're still thinking about this from the wrong perspective. If you > > were writing a program to attack this facility, how would you do it? > > It's not exactly hard to leak one pointer's worth of information. > > > > That would be very hard. Because that program would: > - need to be root > - need to start and pretend it is zus Server with the all mount > thread thing, register new filesystem, grab some pmem devices. > - Mount the said filesystem on said pmem. Create core-pinned ZT threads > for all CPUs, start accepting IO. > - And only then it can start leaking the pointer and do bad things. > The bad things it can do to the application, not to the Kernel. No I think you can do bad things to the kernel at that point. Consider it populating the TLBs on the 'wrong' CPU by 'inadvertenly' touching 'random' memory. Then cause an invalidation and get the page re-used for kernel bits. Then access that page through the 'stale' TLB entry we still have on the 'wrong' CPU and corrupt kernel data.