From patchwork Sat Nov 7 08:24:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Souptick Joarder X-Patchwork-Id: 11888783 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5A6D0921 for ; Sat, 7 Nov 2020 08:24:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 32B882151B for ; Sat, 7 Nov 2020 08:24:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ZzzQ3l9A" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728173AbgKGIYX (ORCPT ); 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-Google-Smtp-Source: ABdhPJwDyY9M/ZHLKKH7UFge4odFt6za4aYpx45k2KdPkqICExycMeEwBaDLIoRl0XpXeeJ5YHr84Q== 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: 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; } From patchwork Sat Nov 7 08:24:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Souptick Joarder X-Patchwork-Id: 11888785 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5EAF8697 for ; Sat, 7 Nov 2020 08:24:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 428DA2151B for ; Sat, 7 Nov 2020 08:24:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="NPl2FG84" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728317AbgKGIYa (ORCPT ); Sat, 7 Nov 2020 03:24:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728153AbgKGIY3 (ORCPT ); Sat, 7 Nov 2020 03:24:29 -0500 Received: from mail-pl1-x641.google.com (mail-pl1-x641.google.com [IPv6:2607:f8b0:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20CAAC0613CF; Sat, 7 Nov 2020 00:24:28 -0800 (PST) Received: by mail-pl1-x641.google.com with SMTP id z1so2061295plo.12; Sat, 07 Nov 2020 00:24:28 -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:in-reply-to:references; bh=Tu3kWxeosmXDoauuhkoszDn3Cj2sxvN5RrGeZRd8L+k=; b=NPl2FG84jc7LQKTk3T2sSekJ3+VWN5yxNn/fCzyGjS9rC68sfFm3m69KCbI5sMDxzg DXcldUFS2ixyJKqkPFeappVmrxu1xSAPps5qDApeYVqYz6hytnKr2e73WGvNISXTRh9t Rgey/lLpfHlwL5NCSXaxX3jVkF884LFJn+iu/WdgIdE56QXy7o3qScew8N0H5C1bj+vK HftZXyvvEK9L33DgF/xSkVFvn4JAXogYWBXX0IOahGRYN941XELseHZlQaKPcK94HdNa A3wGZZPcq3bxsC+C0ARKJBgZZ1zw8QBFbDL/ZIGz9+BU57nhvmRQ6ji8OBvtEDZIaPls yRPA== 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:in-reply-to :references; bh=Tu3kWxeosmXDoauuhkoszDn3Cj2sxvN5RrGeZRd8L+k=; b=QqG/qaC3OOallQrng7e9+iDj+TPlrWMrEE+ISG0WvpiY82tBRhz/KwowMwbZp2rdhd 5kyT4diem7AxZ9d+qkoTfgYuRahRZbBlGj6fxVo7hVXXwfcJVO95ex4gHfd9DyOkIUDX gwA8KBJQJQFbS6BDUJNNMR6MXqiLzG4GthGzbpVRjkELN0COE9dt2Kmsdc/4uWZhZibI 5QUQk03TI1wPZL6MF75NNNklROOqdUj/afQfawq/TtsryhvwXAjwtb/UdCkiLHyRaUWJ oaKFofCTrUzpIMNfAe0tFpnCqo5ypUETKgwaSdINsAON4r4nUaNTZWFQryaaF/BamMDr clvA== X-Gm-Message-State: AOAM530fUEuKLopw0Zs+4X1soFldnM9IRWLiAJd0c1BvmCqQlSgtRj4z A9hAdc6NuFP+/76QXzNf1w4= X-Google-Smtp-Source: ABdhPJyRwRusAKGvDTfhHb0s28hfonRW/6Xs+ConXh5fstgWxMb67p5amzVejehyEZwDLoVDf7W9wQ== X-Received: by 2002:a17:902:23:b029:d5:b88a:c782 with SMTP id 32-20020a1709020023b02900d5b88ac782mr4746076pla.5.1604737467694; Sat, 07 Nov 2020 00:24:27 -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.25 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 07 Nov 2020 00:24:27 -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 2/2] tomoyo: Fixed typo in documentation Date: Sat, 7 Nov 2020 13:54:11 +0530 Message-Id: <1604737451-19082-2-git-send-email-jrdr.linux@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1604737451-19082-1-git-send-email-jrdr.linux@gmail.com> References: <1604737451-19082-1-git-send-email-jrdr.linux@gmail.com> Precedence: bulk List-ID: Fixed typo s/Poiner/Pointer Fixes: 5b636857fee6 ("TOMOYO: Allow using argv[]/envp[] of execve() as conditions.") Signed-off-by: Souptick Joarder Cc: John Hubbard --- security/tomoyo/domain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/tomoyo/domain.c b/security/tomoyo/domain.c index bd748be..7b2babe 100644 --- a/security/tomoyo/domain.c +++ b/security/tomoyo/domain.c @@ -891,7 +891,7 @@ int tomoyo_find_next_domain(struct linux_binprm *bprm) * * @bprm: Pointer to "struct linux_binprm". * @pos: Location to dump. - * @dump: Poiner to "struct tomoyo_page_dump". + * @dump: Pointer to "struct tomoyo_page_dump". * * Returns true on success, false otherwise. */