Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7092579imu; Thu, 31 Jan 2019 04:58:03 -0800 (PST) X-Google-Smtp-Source: ALg8bN7bLvk/Ud7H8RDqztdWDwonntzlwMuP/6GdKNOVoK9Ij8h3Uz8TogdP7qzYsXNPjnUTY7c8 X-Received: by 2002:a17:902:2dc3:: with SMTP id p61mr34083010plb.166.1548939483548; Thu, 31 Jan 2019 04:58:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548939483; cv=none; d=google.com; s=arc-20160816; b=bESvNrLWRxBq2WXxHPzxFkNseF8GqNdyFWWZDvf2cLJ8zNAhT1Quolmwy0/Cg9v9si EwIkUUQ6m5EADQYZezizwtdYAvcPFGuCo7D6VqRGo03PdzNldiSE0VQiYx4tUfn52Uoz 0OpubvV6fJj0S/qNmWdVE0kjNAeFPxcMaAhQqKwdgmgWipI/cmAx/fvX7x82kM9uPEB6 +lb+xK0U33UQOeHIv7+Y31acI69u18NfRx+HqBBEScywz6AAkMWlAKEyQ4PnUEjw047g sylEtZOwiuzzeGtAW1cGCc9H9EWepuNxbXcoUVioTXNH5rjJu2gkx5DXYg2TkhdZ8QRF JjDw== 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:autocrypt:openpgp:from:references:cc:to:subject; bh=wh7c3AaJe8plcN6WQdish8XrugU5Nnn1qCRg6eeqevA=; b=EegU0fmt7OxACfxlsCsBo1x8ZFuVZPk7FLRJE2fISUM7Z80fbo+NtAGWdSakM5lCxV y9t2DVrkVwgR5otvbydVmzoUV11cGdctktbEOQcqT3XEvx5gHTn4xFBHnK01H0b/J3RL DFxvr9WRAV7xkU7fBpXlAszNs+RDaWvkUP2NTvm7W28hJauYOnUVTRyFWMxUHEvnnxYh ZOv9Kr4clDQo+W5ofcSaIkLDnm8w+Dg65yMye2dKNdWCaYfv6ebgoFsE6hoPvmcyN2U6 l8CqG6RVIXx/+1EDc7xtjTYoRGv2P4K4ipgqhxnM/F0MjuBL+ifTC6yJqb6YmGvZ3cW0 jXDw== 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 e13si2133199pfi.271.2019.01.31.04.57.48; Thu, 31 Jan 2019 04:58:03 -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 S1733105AbfAaM5m (ORCPT + 99 others); Thu, 31 Jan 2019 07:57:42 -0500 Received: from gruss.cc ([80.82.209.135]:38468 "EHLO mail.gruss.cc" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732280AbfAaM5m (ORCPT ); Thu, 31 Jan 2019 07:57:42 -0500 Received: from [10.27.152.141] (unknown [129.27.152.126]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: lava@gruss.cc) by mail.gruss.cc (Postfix) with ESMTPSA id 3772F2A0112; Thu, 31 Jan 2019 12:57:40 +0000 (UTC) Subject: Re: [PATCH 2/3] mm/filemap: initiate readahead even if IOCB_NOWAIT is set for the I/O To: Jiri Kosina Cc: Vlastimil Babka , Andrew Morton , Linus Torvalds , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-api@vger.kernel.org, Peter Zijlstra , Greg KH , Jann Horn , Dominique Martinet , Andy Lutomirski , Dave Chinner , Kevin Easton , Matthew Wilcox , Cyril Hrubis , Tejun Heo , "Kirill A . Shutemov" References: <20190130124420.1834-1-vbabka@suse.cz> <20190130124420.1834-3-vbabka@suse.cz> From: Daniel Gruss Openpgp: preference=signencrypt Autocrypt: addr=daniel@gruss.cc; prefer-encrypt=mutual; keydata= mQINBFok/U0BEADLXryCuJ5Y11N5tOGwyRJU4H02+4wrG8cwA6n0yLi7Ff57c/1/MQvCbnEj /Bc9YnujAJJb18QdauUVj9D8AbqDpPk6mR6GUCpeBXLMnzhtK8z/yvNpstwXG7+0J8S7xV7C 7Lht+t75urEjOlB/pL7c0us0ofcXDh5QNfq8jJy5u1hsV+S1JzMC8XAfK6yPfAaOi6K+P1b4 5XAUna6iagIbthivY7ZRa5LLIQFAisrjMHFB1tGklBzm3IxKBowggQJ7zukZHCIFTm3wB2ES SOhmaSvYa7NTOnySAm5WBfmnQ6bbfktFd6D0t+nCo4PVCid6poBr0JuvHIQdPzoUTObSpdBX hNeF+o+ZqnIa0pogddqRA3+PBQ6wqnAm21O8VQNX0sTOSFR0udVURWiZf600l+pY2s+qtxLT 3yFVLIs1sU8qjHcjUtJLSkCw6waM69PCzBeHGxnP6hMdYTwlqatr3OrcfcdH0jNlE3ln05SY 0Emo0zHN2D9Hf1y18iyUu1ygM8rdt48xEJZai3nkw/F/A318Fu98lIXFKBzKFd1uvAc3i59E Y5IVxklQNZhPYq9gUq/unnFmpF5ezeyex0Y+hElUlXGk9YgLvSygsXvIO+T3DpDpVycHIu5k AZ4GC8/YmVgwXRweaMuNeIEnsIKmPCqIQ0fWUMBF90D4C3vcjQARAQABtB5EYW5pZWwgR3J1 c3MgPGRhbmllbEBncnVzcy5jYz6JAk4EEwEIADgCGyMFCwkIBwIGFQgJCgsCBBYCAwECHgEC F4AWIQTczWCjO7iAPF0Z2t17BWSF5qix3QUCW+4oTQAKCRB7BWSF5qix3UuMEACwr9qs7U0R czE25tSDH+hWuewccKhKXOomsMGDULpe9J9HgC2VIGMQkWPRGAn4Yp//9HVPE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 31 Jan 2019 13:57:39 +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:08 PM, Jiri Kosina wrote: > On Thu, 31 Jan 2019, Daniel Gruss wrote: > >> If I understood it correctly, this patch just removes the advantages of >> preadv2 over mmmap+access for the attacker. > > Which is the desired effect. We are not trying to solve the timing aspect, > as I don't think there is a reasonable way to do it, is there? There are two building blocks to cache attacks, bringing the cache into a state, and observing a state change, you can mitigate them by breaking either of these building blocks. For most attacks the attacker would be interested in observing *when* a specific victim page is loaded into the page cache rather than observing whether it is in the page cache right now (it could be there for ages if the system was not under memory pressure). So, one could try to prevent interference in the page cache between attacker and victim -> working set algorithms do that to some extent. Simpler idea (with more side effects) would be limiting the maximum share of the page cache per user (or per process, depending on the threat model)... Cheers, Daniel