From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-f200.google.com (mail-pg1-f200.google.com [209.85.215.200]) by kanga.kvack.org (Postfix) with ESMTP id 4DCA68E0001 for ; Fri, 11 Jan 2019 02:36:10 -0500 (EST) Received: by mail-pg1-f200.google.com with SMTP id d71so7986412pgc.1 for ; Thu, 10 Jan 2019 23:36:10 -0800 (PST) Received: from ipmail06.adl6.internode.on.net (ipmail06.adl6.internode.on.net. [150.101.137.145]) by mx.google.com with ESMTP id b8si8853010pgi.575.2019.01.10.23.36.08 for ; Thu, 10 Jan 2019 23:36:09 -0800 (PST) Date: Fri, 11 Jan 2019 18:36:06 +1100 From: Dave Chinner Subject: Re: [PATCH] mm/mincore: allow for making sys_mincore() privileged Message-ID: <20190111073606.GP27534@dastard> References: <20190110004424.GH27534@dastard> <20190110070355.GJ27534@dastard> <20190110122442.GA21216@nautica> <20190111020340.GM27534@dastard> <20190111040434.GN27534@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: owner-linux-mm@kvack.org List-ID: To: Linus Torvalds Cc: Dominique Martinet , Jiri Kosina , Matthew Wilcox , Jann Horn , Andrew Morton , Greg KH , Peter Zijlstra , Michal Hocko , Linux-MM , kernel list , Linux API On Thu, Jan 10, 2019 at 11:08:07PM -0800, Linus Torvalds wrote: > On Thu, Jan 10, 2019 at 8:04 PM Dave Chinner wrote: > > > > So it will only read the single page we tried to access and won't > > perturb the rest of the message encoded into subsequent pages in > > file. > > Dave, you're being intentionally obtuse, aren't you? > > It's only that single page that *matters*. That's the page that the > probe reveals the status of - but it's also the page that the probe > then *changes* the status of. It changes the state of it /after/ we've already got the information we need from it. It's not up to date, it has to come from disk, we return EAGAIN, which means it was not in the cache. i.e. if we return EAGAIN, we've leaked the inforation the attacker wants regardless of how the act of initiating readahead on the page change the state of the page. Yes, it raises the complexity bar a bit, and lowers the monitoring frequency somewhat, but that's about it. Cheers, Dave. -- Dave Chinner david@fromorbit.com