Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1850018pxb; Sat, 7 Nov 2020 00:26:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJwo72+qgl4rnz2zE/htoL6wn65fxBXUD/XRkkh6snksiSoS8BqMisk2n7UyndXLLLPT3aLI X-Received: by 2002:a05:6402:1cb2:: with SMTP id cz18mr5834073edb.388.1604737576156; Sat, 07 Nov 2020 00:26:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604737576; cv=none; d=google.com; s=arc-20160816; b=aubr43wnwTx1jTs10gl38L5EG1E2rgN7e2bO6EvyrXrGC+H6agkWlieh7aeFFtejgO tB5eAK5rnxnpQ1AalRsM1ENXG4Fwy6G+AmjvifuGOKYYN2UCB/kxCXH4Ig9orLBNpnXg c5wcmW0dWS67Y7bNUCpcVAHhqyM9tRhjvUvITu16ElBg4nLjXlgF2QqtSOmPLFhW9U1j Tz3rbA12u4LkEQhzkfRjGwu3Nm5FA8xgv49xy69NXAa+oGS1gGlDvx6rooDmtBZwW5Nr GGQIg+8nSlEiGEn7j3q5SzFhsFiYyPZIoqHeA2BNpf5xgdE5YdD7ZDbf9UP1qaIkeEJs USwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=X3ARY3PTyer7Z02B1BX5GRWkyi0fpbbIHapRKzO+iJ0=; b=ngrPeUXE8EysS3cUAsXMT6tK3s2A2jtvyW5/E2F5F7VbUJWkEUlltpnBImNUtdsmKU HNdHKyMsCCoQTFPHi3rCQZSUkQqM1VXCx7gZrVlckbxmKgw+GyIw9GEg21knO9ggeJZ7 sT7lOGbeWLBwF1In66QNv3QXyrTB0piqyekv1ClfiHWXknPgQ+dtz2FqEK8g0cFP2VYp USIIpLQJqax0FSASUFUWXq2S+xpWB2L3bQWwhZSsr75yHeIkdkOtE4HZkS7oc4wQIto7 5a+/XNMybvG9L8HN8dQh5JnkFt/Sc1e0wL8JgQwd6jzC0mpbIc/y1oB6HaalVHkBDvwt EDcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ZzzQ3l9A; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id df14si2693080edb.73.2020.11.07.00.25.53; Sat, 07 Nov 2020 00:26:16 -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=@gmail.com header.s=20161025 header.b=ZzzQ3l9A; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728295AbgKGIYX (ORCPT + 99 others); Sat, 7 Nov 2020 03:24:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727833AbgKGIYX (ORCPT ); Sat, 7 Nov 2020 03:24:23 -0500 Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 41E79C0613CF; Sat, 7 Nov 2020 00:24:23 -0800 (PST) Received: by mail-pl1-x642.google.com with SMTP id w11so2071574pll.8; Sat, 07 Nov 2020 00:24:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=X3ARY3PTyer7Z02B1BX5GRWkyi0fpbbIHapRKzO+iJ0=; b=ZzzQ3l9AKBwmLI+dtdEgGqGX/ZKsssAhA+GJ06aiQ8PZth9Qrrrz5yIGPD3q7iWxoU HSjMXPHn6JDCql2/qKSwNEuZzQR/r00tWBllZeL91maZ52t5GU2wBbVZmUkArvrGq0NQ OsMmkw22lelkyDhJPLnNuIiTHnRZ/8K93IytAVwI/kFvRl+JtrHhi/CjAFXzQqerGX6q WJ2tQRLBmcp847yhT7CWAtmUUK+Oo3LO4fPPh+dxBSIzHtpWjXVL+34K+xEPHLTpCIAv TicHcBkc2Ume/SKCswGXC/VQ9Fc1iBl9Tx8Z1DZ+XAik3vQ8kCeNAAV/kiOAw6G0G6C7 m80g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=X3ARY3PTyer7Z02B1BX5GRWkyi0fpbbIHapRKzO+iJ0=; b=mzDJ8fGsT+GzhT9Qj37nu/UVc7NoWHmtN3nGNcGm467IdlqbHd41sl8TezM5aXyNey V4KnekGors1emLxRZiWvMl3hoO/o0LCrRmWhi8x0FJeDzJvy0YjOJ80TAuDnWurjUNow d+CGz8iQPV2sEuOnx5TpoM7sVhO+7loIRMJ9pR8hSMUF9EwREC2GDvt3oVN3qkaf3/Yn aFU63RdWTR+gB0gxi1O5JOvY3WMCLRI14vn6HQg9vNWmxJUSJgKTuJ+4EHI4rXM2j1YI aJK0bbtI1KmSN0yDAv12vMNDn0kCny6m0tJA4GDgBAhNEAWqwB+O7BTVG8XdunXb0Ngq +8vw== X-Gm-Message-State: AOAM530cyMmnn8uMxV7Uqvf6ZBwX1ziqFGcHSqgwjXuxKs8m8vV2FGkW mNnY07tVD6q9jAooOta5c34YKEmGbHfRYw== X-Received: by 2002:a17:90a:17ad:: with SMTP id q42mr3608586pja.36.1604737462838; Sat, 07 Nov 2020 00:24:22 -0800 (PST) Received: from jordon-HP-15-Notebook-PC.domain.name ([122.182.253.68]) by smtp.gmail.com with ESMTPSA id 128sm4705273pfd.110.2020.11.07.00.24.19 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 07 Nov 2020 00:24:22 -0800 (PST) From: Souptick Joarder To: takedakn@nttdata.co.jp, penguin-kernel@I-love.SAKURA.ne.jp, jmorris@namei.org, serge@hallyn.com Cc: linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, Souptick Joarder , John Hubbard Subject: [PATCH 1/2] tomoyo: Convert get_user_pages*() to pin_user_pages*() Date: Sat, 7 Nov 2020 13:54:10 +0530 Message-Id: <1604737451-19082-1-git-send-email-jrdr.linux@gmail.com> X-Mailer: git-send-email 1.9.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In 2019, we introduced pin_user_pages*() and now we are converting get_user_pages*() to the new API as appropriate. [1] & [2] could be referred for more information. This is case 5 as per document [1]. [1] Documentation/core-api/pin_user_pages.rst [2] "Explicit pinning of user-space pages": https://lwn.net/Articles/807108/ Signed-off-by: Souptick Joarder Cc: John Hubbard --- security/tomoyo/domain.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/security/tomoyo/domain.c b/security/tomoyo/domain.c index dc4ecc0..bd748be 100644 --- a/security/tomoyo/domain.c +++ b/security/tomoyo/domain.c @@ -914,7 +914,7 @@ bool tomoyo_dump_page(struct linux_binprm *bprm, unsigned long pos, * (represented by bprm). 'current' is the process doing * the execve(). */ - if (get_user_pages_remote(bprm->mm, pos, 1, + if (pin_user_pages_remote(bprm->mm, pos, 1, FOLL_FORCE, &page, NULL, NULL) <= 0) return false; #else @@ -936,7 +936,7 @@ bool tomoyo_dump_page(struct linux_binprm *bprm, unsigned long pos, } /* Same with put_arg_page(page) in fs/exec.c */ #ifdef CONFIG_MMU - put_page(page); + unpin_user_page(page); #endif return true; } -- 1.9.1