Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp2370944pxb; Sat, 7 Nov 2020 21:02:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJy69VosnjBtQr+5q6gS0Eos2qdOVvnloKSbF3wvDGOVyv4Ig0y2xbNvXkqwhz5WcV3M5WXz X-Received: by 2002:a17:906:3d1:: with SMTP id c17mr9142504eja.187.1604811725644; Sat, 07 Nov 2020 21:02:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604811725; cv=none; d=google.com; s=arc-20160816; b=UT7B0pgSjLjXzc1pAfpjNHrf0b4uDzMUJ66jxSpheTp6j3jS1fWWRrFzeWm3pEYEds vB43kjq/q3ZG++CpTuoZ9aMCRo4KQDNLXcu7qA5tV9lfU2C6+K+SFB0ryn8Ssxkbf1vY ++LCaM5N8D0VRNcFy5I3g1t99pG1SsHwna81orFb7RP5xYXA8MltKk5W9GlzFTLvLsAr W3MzyGZmJ5dSiqYagCqcsW48+IOfI2CAQpKHttYHDZWp86DuATkVn5iz9BDAgGMsy6zR 2BvKfPJ68L3NDANoCXXK8E15eS8x85gfUSKkP2izCVnOos2XLimoNw5yUV3ekDzrX4jB LFQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:dkim-signature:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=0F6FyPkKxLlO1J2Iwb+PkNH/lUr59fnpYgGGqGjgy9s=; b=ktu4NFsAOgA6ANuvxDM39IsZ+HjfoB8E+M7nMfSMmLzKBmAzQ6KTVHjD7F0PC6VAWs J33UwkBu/5ZA1c/eiH65jvoH9x04fFdhsciGsgJoNxX2TpBIZxiqVZ0Y7xlQ6j7dbrea 8/nZjMQxr43dsRij8TNpzl+GXRU54dSWE06RJz3vhGhoCZ9olZdh5OUMPuL5PCTOIiL3 58Fn+pcmOds1QesK6DOp5ikqINQHHX7QMGPYvq1twPAxPPQ4eIIGjTajaDXgHbwt7tHp YyJhUhha5r5NtO2fcVkonFXCPyQxWVbk+xZ3R7WzoemJviFcT9FyQThvANuEB0FAlm90 l/hQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=guvtqofO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ay4si4304384ejb.630.2020.11.07.21.01.42; Sat, 07 Nov 2020 21:02:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=guvtqofO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726206AbgKHFA1 (ORCPT + 99 others); Sun, 8 Nov 2020 00:00:27 -0500 Received: from hqnvemgate26.nvidia.com ([216.228.121.65]:9187 "EHLO hqnvemgate26.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726030AbgKHFA1 (ORCPT ); Sun, 8 Nov 2020 00:00:27 -0500 Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate26.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Sat, 07 Nov 2020 21:00:30 -0800 Received: from [10.2.62.222] (10.124.1.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Sun, 8 Nov 2020 05:00:26 +0000 Subject: Re: [PATCH 1/2] tomoyo: Convert get_user_pages*() to pin_user_pages*() To: Tetsuo Handa , Souptick Joarder CC: , , Jan Kara , Matthew Wilcox , James Morris , "Serge E. Hallyn" References: <1604737451-19082-1-git-send-email-jrdr.linux@gmail.com> <5efeb909-3e02-ba14-7a86-f18562a2fe69@i-love.sakura.ne.jp> <8590eb4c-256b-9ab0-5291-de8ec8d75276@nvidia.com> <40bd424d-6c4d-8b03-5d97-c572ca777b77@i-love.sakura.ne.jp> From: John Hubbard Message-ID: <1174ed3e-d33c-6de9-3873-b122013b295a@nvidia.com> Date: Sat, 7 Nov 2020 21:00:26 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <40bd424d-6c4d-8b03-5d97-c572ca777b77@i-love.sakura.ne.jp> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1604811630; bh=0F6FyPkKxLlO1J2Iwb+PkNH/lUr59fnpYgGGqGjgy9s=; h=Subject:To:CC:References:From:Message-ID:Date:User-Agent: MIME-Version:In-Reply-To:Content-Type:Content-Language: Content-Transfer-Encoding:X-Originating-IP:X-ClientProxiedBy; b=guvtqofOgQi9R86WymuUok80xhTaRW7Ydwf2bzPE7ZlgTFvHZztcJn+uTj9QO4BLF FVi8q2YXZ1wk9KHvnu2QyDtNFM7RXARHcy2oJaUiMthsvwIWx6khreikAVIwciH4gp tNgaUfiAKzRTQn53dtPM/bNCqTkEWS2WLCNXvFRuBUEO0T/LLRMapBerGC/uuy5mFu leFuUbf8jTdR43PTybiEgbfUdd3AaqUPZK31V34Yf1y52DVl9cI6QiThcjGrG4yU10 +xNIvr2Wa2OiPvV57W8nJMWm2I3Qo87x+KbFYjhzNoGkT5nVW15OTpPPWLiHZ+pyBy aB7xU0mlXA4Dg== Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/7/20 8:12 PM, Tetsuo Handa wrote: > On 2020/11/08 11:17, John Hubbard wrote: >>> Excuse me, but Documentation/core-api/pin_user_pages.rst says >>> "CASE 5: Pinning in order to _write_ to the data within the page" >>> while tomoyo_dump_page() is for "_read_ the data within the page". >>> Do we want to convert to pin_user_pages_remote() or lock_page() ? >>> >> >> Sorry, I missed the direction here, was too focused on the Case 5 >> aspect. Yes. Case 5 (which, again, I think we're about to re-document) >> is only about *writing* to data within the page. >> >> So in this case, where it is just reading from the page, I think it's >> already from a gup vs pup point of view. >> >> btw, it's not clear to me whether the current code is susceptible to any >> sort of problem involving something writing to the page while it >> is being dumped (I am curious). But changing from gup to pup wouldn't >> fix that, if it were a problem. It a separate question from this patch. > > The "struct page" tomoyo_dump_page() accesses is argv/envp arguments passed > to execve() syscall. Therefore, these pages are not visible from threads > except current thread, and thus there is no possibility that these pages > are modified by other threads while current thread is reading. > Perfect. So since I accidentally left out the word "correct" above (I meant to write, "it's already correct"), let me be extra clear: Souptick, we should just drop this patch. thanks, -- John Hubbard NVIDIA