Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp437477rwb; Thu, 22 Sep 2022 21:40:24 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6wMJKA03E4YMuZBh7LJj9uawGymoPPh8klbydyQritFztSWuVPZ8Mq3YADr1PUJwifs3fG X-Received: by 2002:a65:58c8:0:b0:438:aecf:5cc8 with SMTP id e8-20020a6558c8000000b00438aecf5cc8mr5982062pgu.18.1663908024569; Thu, 22 Sep 2022 21:40:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663908024; cv=none; d=google.com; s=arc-20160816; b=XedpDGSXdLJ2kUj2TTHSmTv8Dv+M6BXOoE2f9HMhal/9ptDZeuabOjvI4d8aSJulNa 0mPOhJSnnpiighpKJFNC3uba50e3BVjdF8zTzQxkiytgtI3O0N7nl0Brpkd0OJNe1hsu n4b115P9WGStIXz+tLIoANRcQEYGYdwzfMI2jrT1Frs+LV55PHfDtCpptlfdgqFfIbrd t7hzMFrx2h2hwU50ZHX7k6t0jAkuIX8tG1rGX1Ssnjj2+yMmwLHL9AYLfn2lnqEBi5xW kkW/gXfQWQRK5n8BsmQsiurL6fCpTVluZ/ulqP8Q91WSRitpTAcqbWXxMOPVP7+EUzZO TSWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=xkmVItneYtLw119G2aUXBGqgcZPQzVQ6dQC536fhMkI=; b=gTxPjozZgQOskhYYQBvLLCbXzZgHoGm4jEp5ggQZJBTO1IvYPz4OVKuNOS96vSyWuE SvbZiiH45ahL75JBo4/4KCnRaa2gjh5aAit1IRprPIRhEen1oyWtVc1pJFC7Ij1F/z4X UVusY52rNDioeaPtHMQiCEv2Maopm0qA/BLFlvZkdfvTBYlYPB4N+wtzQ74pCdrxaNHH +ZVOROH6/wfK2Yyh/HBoJJGxu242/MpE9BfB9LuzPjm0ZGCU82uQ9JI6TNZf6qzpNu6x 1QtF1epg4fTAHagaMPxH8+YyiWKkyLkoMGLNqAYgf9oVabkzRFCshB08lbjLFPJa4OC3 qLgw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y6-20020a63fa06000000b0042b92e552a2si8133482pgh.182.2022.09.22.21.40.11; Thu, 22 Sep 2022 21:40:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229512AbiIWEjj (ORCPT + 99 others); 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 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII 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 X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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(-) -- v1->v2: use FMODE_EXEC instead of __FMODE_EXEC in nfs4_opendata_access to fix compiler warning v2->v3: update cover letter message