Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1831839ybk; Mon, 11 May 2020 05:28:16 -0700 (PDT) X-Google-Smtp-Source: APiQypJ/6xfe6+UEQus133+S14TcpyAiMPW4xFu/9Gyxp2SmIiZidDyMqSY9wOOtKliClyMqOhiZ X-Received: by 2002:a17:906:328c:: with SMTP id 12mr12270751ejw.69.1589200096298; Mon, 11 May 2020 05:28:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589200096; cv=none; d=google.com; s=arc-20160816; b=0grCIGxlfm/0ZGvHuHQ9Rla72eRuvUUucOfw6YCEIQYhgs0dOsxLPB8hc0YaEOTCvS dQunH7Z/bYjIkHhs2SAgxSaJQ/OP7Y/RLtLrSqlcf9moGK1km7zCTpLXL1w3txlf7tQY wWdrUF9d8Tcrp83+vIvOPcEMWrmiCU+y8ptudE3waT9ATczl/GQqF5yBZGf7WRdLj5l6 ECCpU6L/8dmBywwZaoaTkY9KIenCk7gv/vDrS/cYpVXOe69kp3LhVFgO0vqL4q+wrUwP N7HHrQa0f58ndO+3kxuKB6xHRkl4POiVNNc7qatmTcd5y3Tu4biThxFUVOvpbi1N5jMZ IWKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=2EN8bcyFVSWdG2LyezQQ8oCrjUutuFeHxXpmjXGuS0M=; b=vHYvJgXzvLVq5509UDmWJJms8SKPguu/ZpBODR16QCTN2ksvjFv3vMm3JbUtW13V3c TEoYjgDd2rkFPrQGxAfZczsp7+XwWRc4PpCadNMDRpIJpDMlx4VrqUh92New51M00HgT 5fbkr0m4aZzUexOPbFgWS6sFOlYA5nwPMxNdicStRTT5zqAvqKlL9xwp83dcMqY+BQkk PMX75+rtVNlv+2Fd+WCZQC181Vha4zKQk4yxBcNTbfQMq89OrDg6BI5jnZRzu3WXN288 S0auxSAnOW+7xo5eQh+jN9UapinYe/fDzXlioFTzvTWAbcriBX9nS044jv+nt5ysyCMT FlVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=TocUd7QB; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j1si5679908ejg.178.2020.05.11.05.27.53; Mon, 11 May 2020 05:28:16 -0700 (PDT) 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=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=TocUd7QB; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729984AbgEKM0N (ORCPT + 99 others); Mon, 11 May 2020 08:26:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1729960AbgEKM0I (ORCPT ); Mon, 11 May 2020 08:26:08 -0400 Received: from mail-ed1-x544.google.com (mail-ed1-x544.google.com [IPv6:2a00:1450:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 36D9AC05BD0A for ; Mon, 11 May 2020 05:26:06 -0700 (PDT) Received: by mail-ed1-x544.google.com with SMTP id r7so7753749edo.11 for ; Mon, 11 May 2020 05:26:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=szeredi.hu; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=2EN8bcyFVSWdG2LyezQQ8oCrjUutuFeHxXpmjXGuS0M=; b=TocUd7QBMuxELeVQIclwEwhNwZ51aFXx4DeH5YgrrumzZciDVWnPvzltX/S1ugv1ii 5E0iZOqOZgwgYeazNVKnAscq1Gf0jJaYh7zXejxjfmsLdTBq4ann9CBZ0Zp+Et1gnOx6 csGJZAegn3dXfqJgRVFCHUXWbN4lRvZ4bmgmE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=2EN8bcyFVSWdG2LyezQQ8oCrjUutuFeHxXpmjXGuS0M=; b=rBLAprvMQNW01MApetPcjTwCdyWFRpmr745L0eIPo+X+uqE+wpvGYpXeFpIwwa8nca RBcH5vw1GuFzgYMj9NIzqSKl1H2f4RxQhr3l2jpwKmh9BaWNXOb6XPgtLKfg2j6xnZtj JkHVldnb63YqVp9dak83+0YHh/ouV7QUVld2jAA/LMWycKX2vrg5cROydkM7y839147r AreTXXNHNtOKjdOZA0BMyzYbEck38qGJZqE5+1CAN4BbbEZfZ3NsLHP5geiLQz1ok+9b x7d25hmt4SKQm5SLym7tq0rWgMzUMS+fbtV3Nfikfrs0QtzVcWTTECHym7cMYX+FpOtr ndeg== X-Gm-Message-State: AGi0PuYlsQjH3wRhiymlj1Y9Ce/o4LrKL5QpObvRObtvUXTLHIRe5bSY GLO21WE5YH5nbk/eq9V/ts9Rq9WxuG+44dy/UdXWKA== X-Received: by 2002:aa7:cdd9:: with SMTP id h25mr13644594edw.17.1589199964897; Mon, 11 May 2020 05:26:04 -0700 (PDT) MIME-Version: 1.0 References: <1585733475-5222-1-git-send-email-chakragithub@gmail.com> In-Reply-To: From: Miklos Szeredi Date: Mon, 11 May 2020 14:25:53 +0200 Message-ID: Subject: Re: [PATCH] fuse:rely on fuse_perm for exec when no mode bits set To: Chakra Divi Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 8, 2020 at 12:14 PM Chakra Divi wrote: > > On Tue, Apr 28, 2020 at 1:51 PM Miklos Szeredi wrote: > > > > On Mon, Apr 27, 2020 at 3:46 PM Chakra Divi wrote: > > > > > > On Tue, Apr 21, 2020 at 4:21 PM Chakra Divi wrote: > > > > > > > > On Mon, Apr 20, 2020 at 4:55 PM Miklos Szeredi wrote: > > > > > > > > > > On Wed, Apr 1, 2020 at 11:31 AM Chakra Divi wrote: > > > > > > > > > > > > In current code, for exec we are checking mode bits > > > > > > for x bit set even though the fuse_perm_getattr returns > > > > > > success. Changes in this patch avoids mode bit explicit > > > > > > check, leaves the exec checking to fuse file system > > > > > > in uspace. > > > > > > > > > > Why is this needed? > > > > > > > > Thanks for responding Miklos. We have an use case with our remote file > > > > system mounted on fuse , where permissions checks will happen remotely > > > > without the need of mode bits. In case of read, write it worked > > > > without issues. But for executable files, we found that fuse kernel is > > > > explicitly checking 'x' mode bit set on the file. We want this > > > > checking also to be pushed to remote instead of kernel doing it - so > > > > modified the kernel code to send getattr op to usespace in exec case > > > > too. > > > > > > Any help on this Miklos.... > > > > I still don't understand what you are requesting. What your patch > > does is unconditionally allow execution, even without any 'x' bits in > > the mode. What does that achieve? > > Thanks for the help Miklos. We have a network based filesystem that > supports acls. > As our filesystem give granular access, we wipe out the mode bits and > completely rely on ACLs. Are you using POSIX ACLs? Why can't you translate the ACL's back into mode bits (that's what all filesystems do)? > > Fuse works well for all other ops (with default_permissions disabled ) > as all the checks are done at the filesystems. > But only executables have problems because fuse kernel rejects the > execution by doing access checks on mode bit. > To push this check to filesystem, in the above patch - i'm relying on > return value from fuse_perm_getattr() ignoring the mode bits. > > When the fuse module is asked to rely on filesystem for access checks, > why do we need this explicit check for executables? Because there's no other check. Have you noticed that with your patch *all* files become executable? I guess that's not what you wanted... Thanks, Miklos