Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2015914imu; Sat, 5 Jan 2019 12:16:08 -0800 (PST) X-Google-Smtp-Source: AFSGD/XhflGEb4+fDQ6bQ7Tq3D88aP26yhDN5f++axtGpEuYDGMFISMzsu4HjI7f9w+TPRQdIhcf X-Received: by 2002:a62:5910:: with SMTP id n16mr56749815pfb.128.1546719368803; Sat, 05 Jan 2019 12:16:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546719368; cv=none; d=google.com; s=arc-20160816; b=Em+QomB8vCWELkYcmSFft0M1ChRYWAeP6y5B1FqQE9kbh6pJb6/ruDZm+eoKQq+bDp T2q9Wx5IOE2xZ1Ln9nXTmw4fP9TVfqUi8G8roPN7mkJpfrMURtBXBqul2gI52h1X7TLO HoccbmfZYeT2O/A70nfr47i475v6Sg/Y+hg2XCO4vCxTTZx+/6YL8Z0fPyptP1zn7yf+ DuOF7esIuqZITd8CtPb+l8dg21HU4RvFcLD/CNwJwaqD+XvS9+Q8vo1xi8vspMdqlHr9 mgDOYuxBhDZIrIJ9jdK/jDRS6GNmg8OYisJJVBLw+2l7twG5GDzPGu28xDTzbX0ENph9 EI2w== 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=LAhvqFRZ6hHdtYOT+npiTYOUGyR0EZjyGs1ho8vW3EA=; b=vSSz4JTMnjNEQdtJdbmyQkN7H7DijuFQXPpDpuBX5AqQwiYl2rnC91JvgSj04kEt5u KQHqrs04dppX48HnbiAZnbbNBX9a7hGlv24NKEz7PYRjOFkNQt7esxkUgW/WESjsqn+p SCGJNCeATE3UayquqPFQciOa5Nb/P6EOql12r8SSC43ulZUDYLbzFnxPvA+BkEKk+EvW kGVENdU2a2dzykAbPylPIyCXdmjFTyOsrAanyxGCCKAwD4X9unrsFo9wU0tXmXlq5hCf 49LrbCgL/pJWzFzId29t8P1SqzdQRA0AoCN1/X6Jw89dAMV3ca/5IKz6GnBxAZ4fDWz+ QThg== 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 a1si5648650pgk.495.2019.01.05.12.15.41; Sat, 05 Jan 2019 12:16:08 -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 S1726310AbfAEUMZ (ORCPT + 99 others); Sat, 5 Jan 2019 15:12:25 -0500 Received: from mx2.suse.de ([195.135.220.15]:37144 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726267AbfAEUMY (ORCPT ); Sat, 5 Jan 2019 15:12:24 -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 8E196ADBE; Sat, 5 Jan 2019 20:12:23 +0000 (UTC) Date: Sat, 5 Jan 2019 21:12:22 +0100 (CET) From: Jiri Kosina To: Linus Torvalds cc: Andrew Morton , Greg KH , Peter Zijlstra , Michal Hocko , linux-mm@kvack.org, Linux List Kernel Mailing , linux-api@vger.kernel.org Subject: Re: [PATCH] mm/mincore: allow for making sys_mincore() privileged In-Reply-To: Message-ID: References: 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 Sat, 5 Jan 2019, Linus Torvalds wrote: > > There are possibilities [1] how mincore() could be used as a converyor of > > a sidechannel information about pagecache metadata. > > Can we please just limit it to vma's that are either anonymous, or map > a file that the user actually owns? > > Then the capability check could be for "override the file owner check" > instead, which makes tons of sense. Makes sense. I am still not completely sure what to return in such cases though; we can either blatantly lie and always pretend that the pages are resident (to avoid calling process entering some prefaulting mode), or return -ENOMEM for mappings of files that don't belong to the user (in case it's not CAP_SYS_ADMIN one). -- Jiri Kosina SUSE Labs