Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1297854imu; Wed, 16 Jan 2019 16:40:10 -0800 (PST) X-Google-Smtp-Source: ALg8bN68nKsvzZh4pQJbNyWSY2wfmkC4uln7d6dyGbjvYbSOvfj8fN9bJ5OYrjqVP87nP8pba5B3 X-Received: by 2002:a62:9111:: with SMTP id l17mr12714760pfe.200.1547685610444; Wed, 16 Jan 2019 16:40:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547685610; cv=none; d=google.com; s=arc-20160816; b=nve8UMXSY+3JD6/Slxi3i91vRuVD5TBuRMF/xfoygn55PqekqylHeowOBK7/Ie0Jx1 Wd4VZs2aToTyTjgLEi/9V7ql0WbBqqeSIQ0RWPlR2aVHaUjQvpNXT8/0zxOEEsiuHCvx /Aa+G7V0RiO/t6Cg4YlrZ5jA/oPb8kk8e2XDS4KEz4uVfVQlhN6e5YtZIPjCy0ApMWUG aZXyiAO7vHaxWTUDGD9ZMlQNYax4knN8FJZW3pwMSufytF7T+XVqUJVug3d46wQl9rLt zzvu7bUz7Jy31gkQFczazGwO5VsPcEZdYv6UHRv6m46BzxY59swCmCNTEiCDhy4XpknM KeeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=CsaUJUZ7py1YUxDpHwnWU+LssfzRbRe96qxcmMMTvD8=; b=XNC9K+CKTMdHIOuG9iaj2x7o7uywHyO2X7xHIxIOubrXOuPl9ureCx/TgNmrr5FSP8 8eXgQxWzM/ppx0e+68tcxYNVMyqwHYN5CGAV99pWLpzZQ9XZzPrNdoyJhnJEjfZJO+CV 3MfPE+a3O9t2WTfmC0ByugJ1VV/TPBVH3CT4lpwtK/zogTerU5IcBaqmtamELKQ95rXO WjbY88gRrPjlDl8nh0hP111QEAosJjI5sy+O/eXA/j83M65Og4UlcvMtjG8jXJtuBt+l TFGmx6QQKRP3NRlBLrBYwSl92t350KAEjOh/yafH9xM3w/brKaG3WL0DptJo1kQbxStJ V1tA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a8si7226496pgw.380.2019.01.16.16.39.55; Wed, 16 Jan 2019 16:40:10 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730993AbfAPVlV (ORCPT + 99 others); Wed, 16 Jan 2019 16:41:21 -0500 Received: from mx2.suse.de ([195.135.220.15]:53370 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729361AbfAPVlU (ORCPT ); Wed, 16 Jan 2019 16:41:20 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id BA921AD86; Wed, 16 Jan 2019 21:41:18 +0000 (UTC) Date: Wed, 16 Jan 2019 22:41:16 +0100 (CET) From: Jiri Kosina To: Matthew Wilcox cc: Linus Torvalds , Dominique Martinet , Andy Lutomirski , Josh Snyder , Dave Chinner , Jann Horn , Andrew Morton , Greg KH , Peter Zijlstra , Michal Hocko , Linux-MM , kernel list , Cyril Hrubis , Linux API Subject: Re: [PATCH] mm/mincore: allow for making sys_mincore() privileged In-Reply-To: <20190116213708.GN6310@bombadil.infradead.org> Message-ID: References: <5c3e7de6.1c69fb81.4aebb.3fec@mx.google.com> <9E337EA6-7CDA-457B-96C6-E91F83742587@amacapital.net> <20190116054613.GA11670@nautica> <20190116213708.GN6310@bombadil.infradead.org> User-Agent: Alpine 2.21 (LSU 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 16 Jan 2019, Matthew Wilcox wrote: > > On Thu, 17 Jan 2019, Linus Torvalds wrote: > > > As I suggested earlier in the thread, the fix for RWF_NOWAIT might be > > > to just move the test down to after readahead. > > Your patch 3/3 just removes the test. Am I right in thinking that it > doesn't need to be *moved* because the existing test after !PageUptodate > catches it? Exactly. It just initiates read-ahead for IOCB_NOWAIT cases as well, and if it's actually set, it'll be handled by the !PageUpdtodate case. > Of course, there aren't any tests for RWF_NOWAIT in xfstests. Are there > any in LTP? Not in the released version AFAIK. I've asked the LTP maintainer (in our internal bugzilla) to take care of this thread a few days ago, but not sure what came out of it. Adding him (Cyril) to CC. > Some typos in the commit messages: > > > Another aproach (checking file access permissions in order to decide > "approach" > > > Subject: [PATCH 2/3] mm/mincore: make mincore() more conservative > > > > The semantics of what mincore() considers to be resident is not completely > > clearar, but Linux has always (since 2.3.52, which is when mincore() was > "clear" > > > initially done) treated it as "page is available in page cache". > > > > That's potentially a problem, as that [in]directly exposes meta-information > > about pagecache / memory mapping state even about memory not strictly belonging > > to the process executing the syscall, opening possibilities for sidechannel > > attacks. > > > > Change the semantics of mincore() so that it only reveals pagecache information > > for non-anonymous mappings that belog to files that the calling process could > "belong" Thanks. -- Jiri Kosina SUSE Labs