Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7040918imu; Thu, 31 Jan 2019 04:04:52 -0800 (PST) X-Google-Smtp-Source: ALg8bN6K7RYCb58zG+HiqRjMwP4QEQs3yI1UEwkOgWU7WG8qhpmNTm9+QJZwuwfa+rwLxZhYQ3Kp X-Received: by 2002:a63:d904:: with SMTP id r4mr31429051pgg.207.1548936292818; Thu, 31 Jan 2019 04:04:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548936292; cv=none; d=google.com; s=arc-20160816; b=tXANQHGwPYOHbvUMne0XH8UXDs6oSRVGfUPHSLqxnZoAa1LzXCR3r5oecdsFCHxRA7 Oj8iCrD73rOEdCeDygN9hJHjEfW6UDXIHGAhWx40+71LJ4YA83ZEe+kETnviKSkHJt1X F0CU31MvLQiMylZaQglYY1vVI7bsg+EbmNkZwZ73tHjgAIRrt4Vx9pY0SsggIL+Rd0/W oRkNBII+AYMyEJwX3hiyQi1Scq4eDRZWNEMJ6kok/mnc97GJARYQobDcXRIjxx2LBkG0 cQthMBp0JWs3ZVuLYulZs1sWUZoVhimXL4syODZSMdwY7SVBOyI5dmD5MpVDfdIiSMK/ 0CNQ== 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=FvQS4YPnZ/bQ6XznWHMvr42/u5olXB9zSvFbdP2NIbE=; b=V6FDTLXT8nye9kJtzfY/bhAXtdgaSJ7+i0wdJno30bq7x6r7+rGfEduLAePOk368m9 Q9z5LIrL8/YCWZ7P/YApDXjswWuPzcCyvJXZJTTNkfrBsEy7E0ONAbmG4Msk7SOMF+nv SdqWXSm5gzakVjCt6r3kvbkSugtGJ3AyFwqEtpFAMFzbgbOOucxdHXtXTjK/1Yc39M+s blhZlpjGDWfUAALV6OyJhk8vr8GwjoI/E99Qibf6X0kDChbRM5d4El5ZU8ouvdEXqLo7 DTEHVHv1qgeQ3X1qwGa9MC0dHqpVvpKOmisUe6kBfa3jpuiL9T+2ZqQAoB22/covBQOo pa2A== 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 37si3759353pgw.590.2019.01.31.04.04.37; Thu, 31 Jan 2019 04:04:52 -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 S1732635AbfAaMEV (ORCPT + 99 others); Thu, 31 Jan 2019 07:04:21 -0500 Received: from gruss.cc ([80.82.209.135]:36568 "EHLO mail.gruss.cc" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726977AbfAaMEU (ORCPT ); Thu, 31 Jan 2019 07:04:20 -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 3AC242A008D; Thu, 31 Jan 2019 12:04:17 +0000 (UTC) Subject: Re: [PATCH 2/3] mm/filemap: initiate readahead even if IOCB_NOWAIT is set for the I/O To: Vlastimil Babka , 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: 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+hWuewccKhKXOomsMGDULpe9J9HgC2VIGMQkWPRGA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: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <20190130124420.1834-3-vbabka@suse.cz> 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/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. Cheers, Daniel