Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp436136rwb; Thu, 22 Sep 2022 21:38:21 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6faAi4UNqNkrkE0vbn/6IGCJpNKKErCpzBZeHXAWeYgrVnc8k6mycFMrLrIsn/ZW9taUX0 X-Received: by 2002:a05:6a00:8c8:b0:52c:887d:fa25 with SMTP id s8-20020a056a0008c800b0052c887dfa25mr7256171pfu.86.1663907901145; Thu, 22 Sep 2022 21:38:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663907901; cv=none; d=google.com; s=arc-20160816; b=maVDN0Oh6FSa9ZEr8bDjea3hKeZXcx2z8hqYk0UljCUyTZsO4jN5TxkoxYGA3TX8qd u4VrTnadlm+hMaDJOGNspGGY15wcRYAXeqe+5wEGJyKhd6Dd6y0wXPOjxynW5U1yfIk6 PMR3sXl0UjdlrP4DATBl6HeoTi1ryO/ElSmtLFm6/Db2YFE0c8EeYOt8ehR2Bv9V4LGN lpjWKbRptnK3m5541Lk5sMAfYEOAWI+dzmg9Yem1SXlMqPQ/VzVHYRt+VYxm8W6azD5E W14vHF+TkeVxtkIotZfKGWehH/FxIcQoEl36PGOdK8gvWL2U4HquD0PhI/yoMvzZnMUl yX/w== 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=aSUXbIgJA40bDzBkaTen3aRnzVL/sjsjH7kfDqAdJis=; b=ecQMwAdeJ+BGzxg6uqz9G6dmWtuHqQRPDhoOZ9Ge02vyYYI2jDXuKS8yzrF/I7CDj1 2i3B4ZW2m04JezH/b81JM1BgzmsCRTPibJMHJAu8M1ZhuVo3upXF6o58xhdOFYafxAvE 5m6mIWe/dYma9mPUdKpkHGplRnQa0kHaFhNq8igEI770KHeRqLloDnDFnULGvXgrrdna vV8w53p+r2RNZlNGQ4OXrWNIplx69V5sFSZLzO2hEl7sjxSjnbLXGUfko5W26OcLit1X UKlIlC0+5nEmX0Zc0mnXlI1gy+b8k/T1U7xyVH9qNw9BTI5r4M3ggrSZ9AFhZAc1WVIw zaBA== 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 bd12-20020a656e0c000000b00438c64bda0bsi1966720pgb.162.2022.09.22.21.38.07; Thu, 22 Sep 2022 21:38:21 -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 S229644AbiIWEf3 (ORCPT + 99 others); Fri, 23 Sep 2022 00:35:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58920 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229536AbiIWEf1 (ORCPT ); Fri, 23 Sep 2022 00:35:27 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 35E99EA5A9; Thu, 22 Sep 2022 21:35:26 -0700 (PDT) Received: from dggemv703-chm.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4MYfNf6SlZzlX87; Fri, 23 Sep 2022 12:31:14 +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:35:24 +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:35:23 +0800 From: ChenXiaoSong To: , CC: , , , , Subject: [PATCH v2 0/2] NFS: check FMODE_EXEC from open context mode Date: Fri, 23 Sep 2022 13:36:03 +0800 Message-ID: <20220923053605.2723395-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: dggems703-chm.china.huawei.com (10.3.19.180) 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. 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 2.31.1