From patchwork Fri Sep 23 05:40:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ChenXiaoSong X-Patchwork-Id: 12986120 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9704AECAAD8 for ; Fri, 23 Sep 2022 04:39:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229512AbiIWEjj (ORCPT ); Fri, 23 Sep 2022 00:39:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229639AbiIWEjh (ORCPT ); Fri, 23 Sep 2022 00:39:37 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2A63C5D; Thu, 22 Sep 2022 21:39:30 -0700 (PDT) Received: from dggemv703-chm.china.huawei.com (unknown [172.30.72.56]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4MYfWd0BjDzHpc2; Fri, 23 Sep 2022 12:37:17 +0800 (CST) Received: from kwepemm600015.china.huawei.com (7.193.23.52) by dggemv703-chm.china.huawei.com (10.3.19.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 23 Sep 2022 12:39:28 +0800 Received: from huawei.com (10.175.101.6) by kwepemm600015.china.huawei.com (7.193.23.52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 23 Sep 2022 12:39:27 +0800 From: ChenXiaoSong To: , CC: , , , , Subject: [PATCH v3 0/2] NFS: check FMODE_EXEC from open context mode Date: Fri, 23 Sep 2022 13:40:13 +0800 Message-ID: <20220923054015.2890271-1-chenxiaosong2@huawei.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-Originating-IP: [10.175.101.6] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To kwepemm600015.china.huawei.com (7.193.23.52) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Currently, we check FMODE_EXEC from file f_flags, and check FMODE_READ or FMODE_WRITE from open context mode. After converting file f_flags to open context mode by flags_to_mode(), we can check all mode from open context mode. ChenXiaoSong (2): NFS: make sure open context mode have FMODE_EXEC when file open for exec NFSv4: check FMODE_EXEC from open context mode in nfs4_opendata_access() fs/nfs/inode.c | 3 ++- fs/nfs/nfs4file.c | 12 ++++-------- fs/nfs/nfs4proc.c | 16 +++++----------- 3 files changed, 11 insertions(+), 20 deletions(-)