Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2015918imu; Sat, 5 Jan 2019 12:16:08 -0800 (PST) X-Google-Smtp-Source: AFSGD/X1uPhdAvRN+LfFRsBXIAKrMfJ8wNSz5i7c2PP8II9NuLh+7LeKhvoeqxbuBt8w2ZS2hgdC X-Received: by 2002:a62:c21c:: with SMTP id l28mr56714028pfg.74.1546719368843; 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=dfCAZHEmtzmqORtU3pvILW2zR2hPAISvz6EWM73+zUo6P7IQoG5LV9QM3KgxkT7zpk rm4R9sZGzFtvBiXSv3CCBq/ny5Kni5pStQBpOkMO2vshDIIDnJuKuzlD2xS2zNwyHZH2 wjJ5OugxJaFpIxHygS0VwsnxjdQWjTX4te5s87iFASfYn+JB9kEFCPQxxGhWioyEWYQ/ L+TY+0y83A/dnPBd3NCyghdIwHcR7iEhPMdSf0a50B4GrmM3UeTJ/XiFjiPdTDa2/ZIn 68iiNTdHgNPx3MhXnshNfdWyzM6H6mybyB/Frw1jnyhROUxh8wd2JlgS2RtUm47aEa1p wfsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=Pdi+Bg1i6iYAyJ/YB9jfmxDEJpBzO7ZGd7liVQjUxaA=; b=kPMPzJy3G8QTv1I4CopofKqgajCz86Z02JqbNmmuscvjmswohWXwbWF6cEUvRJW0Kk RF7UrZhN2NXsXDzZD5gKb7OwiU3gAtrH9agTPo4esLtqromwfsCTjA8iKef78ZtiObcY 8uZWec6kGpEbJFWACkmhAWTVXxQoBMx+YnNPJYMWZ2BhOvrRttg7Cj7ZbQ1m+VB4gVEO ywgrjbNZV4yNZJA8Vh4c9XnHdCjXhYiUXhIzdmgOj8A6D4ujR+9/8RW3wmk15KEX/JKP fWB38MuCAcWsJ4XcH2dAIdg0S4CQDG5yVrvCpfyCvZidf7bfxfHhAQ3t2qF2L0xGbler 9c6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=Ovm4s7qz; 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 123si42535203pfx.109.2019.01.05.12.15.40; 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; dkim=pass header.i=@linux-foundation.org header.s=google header.b=Ovm4s7qz; 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 S1726356AbfAEUNW (ORCPT + 99 others); Sat, 5 Jan 2019 15:13:22 -0500 Received: from mail-lj1-f194.google.com ([209.85.208.194]:46228 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726267AbfAEUNW (ORCPT ); Sat, 5 Jan 2019 15:13:22 -0500 Received: by mail-lj1-f194.google.com with SMTP id v15-v6so35081119ljh.13 for ; Sat, 05 Jan 2019 12:13:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Pdi+Bg1i6iYAyJ/YB9jfmxDEJpBzO7ZGd7liVQjUxaA=; b=Ovm4s7qzBlZaFkhRQHYQAfhZuyMy8xnAoaOuLMym+53o/QgkGGfnxgHlttRFkYO0Gj 7+uqgCM/NMv2jKFKNKxBNgXexzIvyLZduESW3zVSmxX5oY85FuDM23SDZkRu/VBjDrFH ktPUT1ftZfADhqSMujGo9gCGz4FRn/hgRLlz8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Pdi+Bg1i6iYAyJ/YB9jfmxDEJpBzO7ZGd7liVQjUxaA=; b=PS9xlBtyVvKnWUI4qIfsbvy+6pJMMz9MgrC2DCCEwQZAGYgNr8ZtPz18cVzJY3ShGH rUx8jcTQd76/lLgte5u3ZzDLG8b1k1yCcFoOteMqnRT0dfXTbBJmA1sFwf3qk2G/yL1T wfGVnaXDze8p4Rn8O8wlyyd2mdljfG3SVKKAwIxOnYVw35Y2HhHn7BN1IuFvMqZuScWU 0JZMZC87e6TShnC1E8tle9GEAsyjNyiFE3eZ04ReNDtVoSzh9kJgHFXG8purfTRtYSkp Aw6glZEfLH9HlB4STHMfbiKjsT9IdWeayF+bNxHmxifFsbqf/nwmvPZuvktuCW2ELUFk OUSA== X-Gm-Message-State: AJcUukdvlqyMhqUn4qtJSUO1NzqatsJzIwKAI4MEYbeP0AG3jmS27vG5 a0ImCjwGTj4+G0xmDNzf5/F8L0YND9o= X-Received: by 2002:a2e:5054:: with SMTP id v20-v6mr31243424ljd.45.1546719200193; Sat, 05 Jan 2019 12:13:20 -0800 (PST) Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com. [209.85.167.43]) by smtp.gmail.com with ESMTPSA id b21sm11757204lfi.7.2019.01.05.12.13.18 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 05 Jan 2019 12:13:19 -0800 (PST) Received: by mail-lf1-f43.google.com with SMTP id p6so27672950lfc.1 for ; Sat, 05 Jan 2019 12:13:18 -0800 (PST) X-Received: by 2002:a19:3fcf:: with SMTP id m198mr26631654lfa.106.1546719198576; Sat, 05 Jan 2019 12:13:18 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Linus Torvalds Date: Sat, 5 Jan 2019 12:13:01 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] mm/mincore: allow for making sys_mincore() privileged To: Jiri Kosina Cc: Andrew Morton , Greg KH , Peter Zijlstra , Michal Hocko , linux-mm@kvack.org, Linux List Kernel Mailing , linux-api@vger.kernel.org Content-Type: multipart/mixed; boundary="0000000000006646d6057ebba023" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --0000000000006646d6057ebba023 Content-Type: text/plain; charset="UTF-8" On Sat, Jan 5, 2019 at 11:46 AM Linus Torvalds wrote: > > Can we please just limit it to vma's that are either anonymous, or map > a file that the user actually owns? .. or slightly simpler: a file that the user opened for writing. IOW, some (TOTALLY UNTESTED!) patch like this? Linus --0000000000006646d6057ebba023 Content-Type: text/x-patch; charset="US-ASCII"; name="patch.diff" Content-Disposition: attachment; filename="patch.diff" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_jqjwnxes0 IG1tL21pbmNvcmUuYyB8IDE0ICsrKysrKysrKysrKystCiAxIGZpbGUgY2hhbmdlZCwgMTMgaW5z ZXJ0aW9ucygrKSwgMSBkZWxldGlvbigtKQoKZGlmZiAtLWdpdCBhL21tL21pbmNvcmUuYyBiL21t L21pbmNvcmUuYwppbmRleCAyMTgwOTliNWVkMzEuLjYxZTM4ODk1ZmIwMiAxMDA2NDQKLS0tIGEv bW0vbWluY29yZS5jCisrKyBiL21tL21pbmNvcmUuYwpAQCAtMTY5LDYgKzE2OSwxMyBAQCBzdGF0 aWMgaW50IG1pbmNvcmVfcHRlX3JhbmdlKHBtZF90ICpwbWQsIHVuc2lnbmVkIGxvbmcgYWRkciwg dW5zaWduZWQgbG9uZyBlbmQsCiAJcmV0dXJuIDA7CiB9CiAKK3N0YXRpYyBpbmxpbmUgYm9vbCBj YW5fZG9fbWluY29yZShzdHJ1Y3Qg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