Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7046369imu; Thu, 31 Jan 2019 04:09:06 -0800 (PST) X-Google-Smtp-Source: ALg8bN6yCerZqt6Lmxtyx1h0nc32nSZRUZn+tsP50IGwxOdBmB0ydTeSIJzPfDg72zrihdR+R2tM X-Received: by 2002:a17:902:9a81:: with SMTP id w1mr33165343plp.19.1548936546519; Thu, 31 Jan 2019 04:09:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548936546; cv=none; d=google.com; s=arc-20160816; b=VrHpLTfhGydu74H1Vng/uGoTm4j12Fm6Z1FCcGZlovOuQlojnU1EPYiq8zWAxC5vMO JHOiEkpN0+Hh+C/7NjAIiSbezv0XZeMzIOiNn9/fhGfPJ8wAU0VSx2VK52rX4aCQWObS 2/MBtmO0MOGMObuzNZ+xKWYBQa5dJUZ2u1h0qwxjprwRd5HodmbF69lUAfTpO1ERz7cy +UnihiRKd2NPtmGR6HvgnlQUXqCIE1km7UCO2NOvVX6+yhh9VWvl5lh8tfdKN1nvhLBI w+2xO60tPIMxz6KoJS9+m0R56NXcC2RksLBgOJH4lOC+kUs5E99L3rP4WArtSpMMksvc LaNw== 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:openpgp:from:references:cc:to:subject; bh=u+FaHBTN9Rvp/rKKC4326DtKNKbqEn/u9aBjqOorK1Y=; b=nEQEWClStf/hw8sgTFLaonl1oSbCLwlMbMCTZzSqj+8nEK0VVMH1tRZi2b1i+8yw8G PRDLtmy0QOWieaQh+zpfLajvXvk5yRJAEZ3zKEBHevQwMJtSJWWkO6hmD8vZQ5nNRlr0 cTSYywR3RqXUacfJACQewnBILFOOiThPGmjhHtSkMn/rbp5WggM9fEHGgUPXBCawZe1B mtOx/4oUQd3rHQqK3TFQnMStIkU8iswa83u9vH29PwGhSm6w1ySic8vsdBFoMoxpwVX4 L/P+5kxdJvU+4vOttK8AVu2UeMrEm09RgF5ELKp/f3rYP9s9G58LFRrIpBgUUIgBzDFt JVGQ== 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 g1si4164650pgj.34.2019.01.31.04.08.50; Thu, 31 Jan 2019 04:09:06 -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 S1732667AbfAaMHA (ORCPT + 99 others); Thu, 31 Jan 2019 07:07:00 -0500 Received: from mx2.suse.de ([195.135.220.15]:41114 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726977AbfAaMHA (ORCPT ); Thu, 31 Jan 2019 07:07:00 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 327A4AC4B; Thu, 31 Jan 2019 12:06:59 +0000 (UTC) Subject: Re: [PATCH 2/3] mm/filemap: initiate readahead even if IOCB_NOWAIT is set for the I/O To: Daniel Gruss , Andrew Morton , Linus Torvalds Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-api@vger.kernel.org, Peter Zijlstra , Greg KH , Jann Horn , Jiri Kosina , Dominique Martinet , Andy Lutomirski , Dave Chinner , Kevin Easton , Matthew Wilcox , Cyril Hrubis , Tejun Heo , "Kirill A . Shutemov" , Jiri Kosina References: <20190130124420.1834-1-vbabka@suse.cz> <20190130124420.1834-3-vbabka@suse.cz> From: Vlastimil Babka Openpgp: preference=signencrypt Message-ID: Date: Thu, 31 Jan 2019 13:06:58 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: 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 1/31/19 1:04 PM, Daniel Gruss wrote: > On 1/30/19 1:44 PM, Vlastimil Babka wrote: >> Close that sidechannel by always initiating readahead on the cache if we >> encounter a cache miss for preadv2(RWF_NOWAIT); with that in place, probing >> the pagecache residency itself will actually populate the cache, making the >> sidechannel useless. > > I fear this does not really close the side channel. You can time the > preadv2 function and infer which path it took, so you just bring it down > to the same as using mmap and timing accesses. > If I understood it correctly, this patch just removes the advantages of > preadv2 over mmmap+access for the attacker. But isn't that the same with mincore()? We can't simply remove the possibility of mmap+access, but we are closing the simpler methods? Vlastimil > Cheers, > Daniel >