From: Steve French <smfrench@austin.rr.com>
To: Miklos Szeredi <miklos@szeredi.hu>,
hch@infradead.org, 7eggert@gmx.de, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] cifs: handle termination of cifs oplockd kernel thread
Date: Sat, 30 Apr 2005 08:28:27 -0500 [thread overview]
Message-ID: <427387FB.4030901@austin.rr.com> (raw)
In-Reply-To: <E1DRpfS-0002Nc-00@dorka.pomaz.szeredi.hu>
Miklos Szeredi wrote:
>>> - network/userspace filesystems should be fine aswell
>>>
>>>
>>They should, but again I wonder if NFS with all it's complexity is
>>being careful enough with what it accepts from the server.
>>
>>
That is the fun of trying to get our network filesystems up to the 20th
century. There is
at lot more work that has to be done here, but it is gradually
improving. At least for cifs
but probably for NFSv4 (and possibly AFS) it is possible for the client
to validate that the
server is who it says it is, and both NFSv4 (actually the newer NFS RPC)
and CIFS of course
allow packet signing which helps, not sure if AFS allows packet
signing. There does
need to be even more testing in one area though - selective packet
corruption testing
(which can be done by temporarily modifying the server to inject random
invalid packet
information on a subset of fields every thousand packets or so) since
the biggest danger
in network filesystems is the huge variety of servers with different
server bugs that you have
to be able to workaround. Working around server bugs is a huge problem with
the client side of networking code.
>>I take that back. Any filesystem using page cache and allowing shared
>>writable mapping is currently unsafe because of OOM deadlock if
>>mounted from local machine, or simply DoS against client by delaying
>>writeback.
>>
>>So other than FUSE, what's left as safe?
>>
>>Miklos
>>
Don't see how FUSE is that much safer, if you allocate kernel memory at
all you eventually can create DoS,
and you can not do a filesystem without allocating some kernel memory,
but it does not seem that easy to
do intentionally. At least for the CIFS case you can turn off the page
cache for inode data on a per mount
basis (with the forcedirectio mount flag) if you worry about the server
intentionally holding up writes.
Unless the write is past end of file, writes are timed out reasonably
quickly anyway, and end up
killing the session, which depending on the setting of the hard/soft
flag probably should result in a page fault.
There is one remaining issue with mount and umount - the user space
utilities. By the way who maintains
them these days? Although the mount utilities allow filesystem
specific mount and umount helpers
to be placed in /sbin and automatically executed for the matching
filesystem type, there are a few functions
that belong in common code - in a system library which today have to be
implemented in every helper
function and of course are implemented in different ways in different
distros and
different tools with possibility of corruption of the /etc/mtab. It
may be that the file /etc/mtab
does not matter and that it needs to go away and everyone needs to look
at /proc/mounts instead, but
in the meantime /etc/mtab can easily get out of sync with the actual
list of mounts, although that
usuallly does not prevent unmount from working it may be confusing.
The basic problem is that the
"lock the mtab / add a new line to it / unlock" is not available in an
exported function (alternatively if
lock and unlock mtab functions were exported that would help) and
similarly with umount.there
is no "safely remove the matching line from mtab" - Looking at the
mount utils and various mount helper
functions it looks like you can not make any assumptions about the name
of the lock file used to protect
mtab (I am not even sure that you can guarantee that /etc/mtab is a
file, or even a symlink).
the lock file used to lock the mtab
next prev parent reply other threads:[~2005-04-30 14:31 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <3YLdQ-4vS-15@gated-at.bofh.it>
2005-04-29 23:18 ` [PATCH] cifs: handle termination of cifs oplockd kernel thread Bodo Eggert <harvested.in.lkml@posting.7eggert.dyndns.org>
2005-04-30 7:32 ` Christoph Hellwig
2005-04-30 8:14 ` Miklos Szeredi
2005-04-30 8:29 ` Christoph Hellwig
2005-04-30 9:22 ` Miklos Szeredi
2005-04-30 10:57 ` Miklos Szeredi
2005-04-30 13:28 ` Steve French [this message]
2005-04-30 14:53 ` J. Bruce Fields
2005-04-30 14:50 ` Steve French
2005-04-30 17:23 ` Miklos Szeredi
2005-04-30 16:16 ` Miklos Szeredi
2005-04-30 15:27 ` Steve French
2005-05-01 0:10 ` Bodo Eggert
2005-05-11 8:59 ` Christoph Hellwig
2005-04-30 12:52 ` Steve French
2005-04-29 21:09 Steve French
2005-04-29 21:31 ` Christoph Hellwig
2005-04-29 22:20 ` Steve French
2005-05-11 8:56 ` Christoph Hellwig
2005-05-11 18:19 ` Steve French
2005-05-16 9:34 ` Christoph Hellwig
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=427387FB.4030901@austin.rr.com \
--to=smfrench@austin.rr.com \
--cc=7eggert@gmx.de \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=miklos@szeredi.hu \
/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