All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Waychison <Michael.Waychison@Sun.COM>
To: Jim Carter <jimc@math.ucla.edu>
Cc: autofs mailing list <autofs@linux.kernel.org>,
	Ian Kent <raven@themaw.net>
Subject: Re: [patch] buffer overflow, failure to auto-dismount, log file diarrhea
Date: Fri, 09 Jan 2004 17:00:23 -0500	[thread overview]
Message-ID: <3FFF2477.9060909@sun.com> (raw)
In-Reply-To: <Pine.LNX.4.53.0401091330490.9335@simba.math.ucla.edu>


[-- Attachment #1.1: Type: text/plain, Size: 3058 bytes --]

Jim Carter wrote:

>On Fri, 9 Jan 2004, Mike Waychison wrote:
>
>  
>
>>Jim Carter wrote:
>>    
>>
>>>No, I meant that when the sys_stat method fills in the mode field of
>>>the returning stat structure, it would be reported as 555 for a busy
>>>filesystem, or 755 if it looks idle and dismountable.  The mode field as
>>>seen by the VFS layer can stay at 755.  This would be when statting
>>>autofs's directory inode, not whatever is mounted on it.
>>>      
>>>
>
>  
>
>>This hijacking of the st_mode is just that, hijacking.  You'd be
>>changing the mode of the directory on the NFS filesystem..  This
>>wouldn't work well in the VFS when it tries to check permissions, but it
>>also wouldn't work for more than one NFS client accessing the same
>>filehandle.
>>    
>>
>
>There are 2 inodes here: the mount point (owned by autofs) and what's
>mounted on it.  We mustn't monkey with the mountee's data, of course.  I'm
>talking about statting the mount point itself.  You can't do that by name,
>but in a prior discussion we were talking about opening the mount point
>before the mount, and later doing fstat on the file descriptor.  HPA
>mentioned providing a readlink method and doing lstat on the mount point by
>name, which would intercept the path walk before the mountee was noticed.
>
>So the caller gets the mode of the mount point, which autofs can create or
>interpret any way it wants, rather than the mountee's data.
>
>  
>
Ok.  Then the kernel would need to periodically make these checks..   It 
could work, but I see it as yet another communication kludge.

>>>I would really like it if, when autofs decided to forcibly unmount, it
>>>could kill the using processes, as in "fuser -k -m /net/host/mountpoint".
>>>Actually this is a general issue for unmount(8), not specific to autofs.
>>>But one wonders whether fuser is going to run wild...
>>>      
>>>
>
>  
>
>>Like HPA already mentioned, this is bad.  I don't even think you could
>>reliably detect this.
>>    
>>
>
>Agreed, you wonder if the right processes are going to be picked.  But...
>"Ask for the moon; they might give it to you."  In the present case it
>should be possible to stick the fuser execution into the autofs shutdown
>script -- it already is aware that unmounts haven't finished, and it
>probably knows or can find out which filesystems are involved.
>
>  
>
This probably isn't best placed in the initscript.  The automount daemon 
should instead have a timeout setup for unmounting these filesystems.  
If the unmount hangs for more than x seconds, move on to the next one.   
Let init take care of killing off processes if they haven't died in time 
for shutdown. 

-- 
Mike Waychison
Sun Microsystems, Inc.
1 (650) 352-5299 voice
1 (416) 202-8336 voice
mailto: Michael.Waychison@Sun.COM
http://www.sun.com

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NOTICE:  The opinions expressed in this email are held by me, 
and may not represent the views of Sun Microsystems, Inc.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 


[-- Attachment #1.2: Type: application/pgp-signature, Size: 251 bytes --]

[-- Attachment #2: Type: text/plain, Size: 140 bytes --]

_______________________________________________
autofs mailing list
autofs@linux.kernel.org
http://linux.kernel.org/mailman/listinfo/autofs

  reply	other threads:[~2004-01-09 22:00 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-21 18:56 [patch] buffer overflow, failure to auto-dismount, log file diarrhea Jim Carter
2003-11-22  8:20 ` Ian Kent
2003-11-26 18:39   ` Jim Carter
2003-11-27 14:08     ` Ian Kent
2004-01-01 13:12     ` Ian Kent
2004-01-01 22:49       ` Jim Carter
2004-01-02  0:35         ` Ian Kent
2004-01-03  1:03           ` Jim Carter
2004-01-03  3:47             ` Ian Kent
2004-01-09 19:58               ` Jim Carter
2004-01-09 20:17                 ` H. Peter Anvin
2004-01-09 21:11                   ` Jim Carter
2004-01-10  5:09                     ` Ian Kent
2004-01-09 21:27                 ` Mike Waychison
2004-01-09 21:43                   ` Jim Carter
2004-01-09 22:00                     ` Mike Waychison [this message]
2004-01-10  5:06                 ` Ian Kent

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=3FFF2477.9060909@sun.com \
    --to=michael.waychison@sun.com \
    --cc=autofs@linux.kernel.org \
    --cc=jimc@math.ucla.edu \
    --cc=raven@themaw.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.