mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jan Hudec <bulb@ucw.cz>
To: linux-kernel@vger.kernel.org
Subject: Re: question: permission checking for network filesystem
Date: Tue, 22 May 2001 10:10:07 +0200	[thread overview]
Message-ID: <20010522101007.A15555@artax.karlin.mff.cuni.cz> (raw)
In-Reply-To: <20010521153246.A9454@artax.karlin.mff.cuni.cz> <Pine.LNX.3.96.1010521233913.27071A-100000@artax.karlin.mff.cuni.cz>
In-Reply-To: <Pine.LNX.3.96.1010521233913.27071A-100000@artax.karlin.mff.cuni.cz>; from mikulas@artax.karlin.mff.cuni.cz on Tue, May 22, 2001 at 12:26:47AM +0200

> You can write lookup so that it always succeeds and returns dummy inode
> without sending anything and do all the work in open & inode operations.
 
It'd be great if I could. But I can't. First, the inode data are checked by
some vfs functions before driver is called (this being the bigest problem:
if (S_ISDIR(inode->i_mode) && (flag & FMODE_WRITE)) goto exit;
- I think these checks could be, perhaps better, done by having right
i_fop->open on different types of inodes)

It could be done partialy (ie. returning dummy data for all but the last
inode in path_walk) if path_walk passed LOOKUP_CONTINUE to i_ops->lookup
(it's passed to d_ops->d_revalidate so NFS can avoid revalidating inodes on
the way). I think adding this flag to i_ops->lookup won't break anything
and make path_walk more self-consistent. (Also passing all flags from
path_walk might help some optimization).

> > exclusivity of write versus execute is the other
> > (can't be workaround).
> 
> MAP_DENYWRITE is used for this. If somebody is mapping file with
> MAP_DENYWRITE, lock it on server. Write locking does not depend on exec,
> and it is bad to expect that it may be used only in exec. 

There is one problem - I don't get to get/deny_write_permission functions.
They operate on i_writecount and don't call the driver. MAP_DENYWRITE must
be solved by mandatory write-lock on the file... I still think it's better
to check permission in open (

Anyway, is there any reason file->f_ops->open shouldn't have the
information inode->i_ops->permission had? Even if I unite opening for read
and for exec, permissions still have to be queried and permission is
definitely no good place. Lookup might do, but it might not do on other
operating systems.

--------------------------------------------------------------------------------
                  				- Jan Hudec `Bulb' <bulb@ucw.cz>

  reply	other threads:[~2001-05-22  8:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-05-20 15:29 Jan Hudec
2001-05-20 22:49 ` Mikulas Patocka
2001-05-21  3:04   ` David Wagner
2001-05-21 13:32   ` Jan Hudec
2001-05-21 22:26     ` Mikulas Patocka
2001-05-22  8:10       ` Jan Hudec [this message]
     [not found] ` <200105220602.f4M62N364271@saturn.cs.uml.edu>
2001-05-24 12:52   ` Jan Hudec

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010522101007.A15555@artax.karlin.mff.cuni.cz \
    --to=bulb@ucw.cz \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®