All of lore.kernel.org
 help / color / mirror / Atom feed
* nonroot umount
       [not found] <200607100726.k6A7Po1e029994@hera.kernel.org>
@ 2006-07-10 23:26 ` Marcos Diez
  2006-07-11 12:39   ` Peter Staubach
  0 siblings, 1 reply; 6+ messages in thread
From: Marcos Diez @ 2006-07-10 23:26 UTC (permalink / raw)
  To: autofs

In a Unix desktop system automount is very practical for CDROMs, digital
cameras, USB flash drives and any other type of removable media.
But it is annoying to the unprivileged user to wait the timeout to
remove the media.

Since it is insecure to allow the user to do a "killall -s SIGUSR1
automount", I wrote a program that does exactly (and only) that. Of
course it must be suid root, but it makes life much easier. I double
verified that there are no buffer overflows and I believe it's safe. The
program is not interactive, so a malicious user can't do much with it
anyway.

It gets the PIDs from instances of automount by parsing /proc/mounts
It would be nice if it could be added to the autofs distribution.


http://boby.unitron.com.br/%7Emarcos/umounter.c


To compile:

gcc -O3 -ansi -Wall -pedantic umounter.c -o umounter

To install:
cp umounter /usr/local/bin && chmod 4711 /usr/local/bin/umounter

To use:

./umounter
or
./umounter --verbose
(show the signaled PIDs )


Thanks

-- 
Marcos Diez
+49 178 507 9577
Skype: aboboraabobora

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: nonroot umount
  2006-07-10 23:26 ` Marcos Diez
@ 2006-07-11 12:39   ` Peter Staubach
  2006-07-11 13:47     ` Jeff Moyer
  0 siblings, 1 reply; 6+ messages in thread
From: Peter Staubach @ 2006-07-11 12:39 UTC (permalink / raw)
  To: Marcos Diez; +Cc: autofs

Marcos Diez wrote:

>In a Unix desktop system automount is very practical for CDROMs, digital
>cameras, USB flash drives and any other type of removable media.
>But it is annoying to the unprivileged user to wait the timeout to
>remove the media.
>
>Since it is insecure to allow the user to do a "killall -s SIGUSR1
>automount", I wrote a program that does exactly (and only) that. Of
>course it must be suid root, but it makes life much easier. I double
>verified that there are no buffer overflows and I believe it's safe. The
>program is not interactive, so a malicious user can't do much with it
>anyway.
>
>It gets the PIDs from instances of automount by parsing /proc/mounts
>It would be nice if it could be added to the autofs distribution.
>
>
>http://boby.unitron.com.br/%7Emarcos/umounter.c
>
>
>To compile:
>
>gcc -O3 -ansi -Wall -pedantic umounter.c -o umounter
>
>To install:
>cp umounter /usr/local/bin && chmod 4711 /usr/local/bin/umounter
>
>To use:
>
>./umounter
>or
>./umounter --verbose
>(show the signaled PIDs )
>

It seems to me that a better architected solution might be to tie in
the automounter with the eject(1) sort of command.

It is not good for a user to have to know that he needs to zing the
automounter in order to remove his media.

    Thanx...

       ps

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: nonroot umount
  2006-07-11 12:39   ` Peter Staubach
@ 2006-07-11 13:47     ` Jeff Moyer
  2006-07-11 14:09       ` Peter Staubach
  0 siblings, 1 reply; 6+ messages in thread
From: Jeff Moyer @ 2006-07-11 13:47 UTC (permalink / raw)
  To: Peter Staubach; +Cc: autofs, Marcos Diez

==> Regarding Re: [autofs] nonroot umount; Peter Staubach <staubach@redhat.com> adds:

staubach> Marcos Diez wrote:
>> In a Unix desktop system automount is very practical for CDROMs, digital
>> cameras, USB flash drives and any other type of removable media.
>> But it is annoying to the unprivileged user to wait the timeout to
>> remove the media.
>> 
>> Since it is insecure to allow the user to do a "killall -s SIGUSR1
>> automount", I wrote a program that does exactly (and only) that. Of
>> course it must be suid root, but it makes life much easier. I double
>> verified that there are no buffer overflows and I believe it's safe. The
>> program is not interactive, so a malicious user can't do much with it
>> anyway.
>> 
>> It gets the PIDs from instances of automount by parsing /proc/mounts
>> It would be nice if it could be added to the autofs distribution.
>> 
>> 
>> http://boby.unitron.com.br/%7Emarcos/umounter.c
>> 
>> 
>> To compile:
>> 
>> gcc -O3 -ansi -Wall -pedantic umounter.c -o umounter
>> 
>> To install:
>> cp umounter /usr/local/bin && chmod 4711 /usr/local/bin/umounter
>> 
>> To use:
>> 
>> ./umounter
>> or
>> ./umounter --verbose
>> (show the signaled PIDs )
>> 

staubach> It seems to me that a better architected solution might be to tie in
staubach> the automounter with the eject(1) sort of command.

staubach> It is not good for a user to have to know that he needs to zing the
staubach> automounter in order to remove his media.

What "desktop" system are we talking about?  If you're using hal/udev, then
they have a much nicer mechanism for handling such things.  Autofs isn't
really a good fit for removable media, in my experience.

-Jeff

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: nonroot umount
  2006-07-11 13:47     ` Jeff Moyer
@ 2006-07-11 14:09       ` Peter Staubach
  0 siblings, 0 replies; 6+ messages in thread
From: Peter Staubach @ 2006-07-11 14:09 UTC (permalink / raw)
  To: Jeff Moyer; +Cc: autofs, Marcos Diez

Jeff Moyer wrote:

>==> Regarding Re: [autofs] nonroot umount; Peter Staubach <staubach@redhat.com> adds:
>
>staubach> Marcos Diez wrote:
>  
>
>>>In a Unix desktop system automount is very practical for CDROMs, digital
>>>cameras, USB flash drives and any other type of removable media.
>>>But it is annoying to the unprivileged user to wait the timeout to
>>>remove the media.
>>>
>>>Since it is insecure to allow the user to do a "killall -s SIGUSR1
>>>automount", I wrote a program that does exactly (and only) that. Of
>>>course it must be suid root, but it makes life much easier. I double
>>>verified that there are no buffer overflows and I believe it's safe. The
>>>program is not interactive, so a malicious user can't do much with it
>>>anyway.
>>>
>>>It gets the PIDs from instances of automount by parsing /proc/mounts
>>>It would be nice if it could be added to the autofs distribution.
>>>
>>>
>>>http://boby.unitron.com.br/%7Emarcos/umounter.c
>>>
>>>
>>>To compile:
>>>
>>>gcc -O3 -ansi -Wall -pedantic umounter.c -o umounter
>>>
>>>To install:
>>>cp umounter /usr/local/bin && chmod 4711 /usr/local/bin/umounter
>>>
>>>To use:
>>>
>>>./umounter
>>>or
>>>./umounter --verbose
>>>(show the signaled PIDs )
>>>
>>>      
>>>
>
>staubach> It seems to me that a better architected solution might be to tie in
>staubach> the automounter with the eject(1) sort of command.
>
>staubach> It is not good for a user to have to know that he needs to zing the
>staubach> automounter in order to remove his media.
>
>What "desktop" system are we talking about?  If you're using hal/udev, then
>they have a much nicer mechanism for handling such things.  Autofs isn't
>really a good fit for removable media, in my experience.
>

Cool!

My only objection was building tools to utilize automount specific
implementation details.  That's just wrong.

Perhaps we need to redirect Marcos Diez to better functionality to
solve his problems...  :-)

    Thanx...

       ps

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: nonroot umount
@ 2006-07-11 22:56 Jim Dennis
  2006-07-11 23:12 ` Jeff Moyer
  0 siblings, 1 reply; 6+ messages in thread
From: Jim Dennis @ 2006-07-11 22:56 UTC (permalink / raw)
  To: autofs

 

On Date: Tue, 11 Jul 2006 08:39:01 -0400
Peter Staubach <staubach@redhat.com> wrote (in response to Marcos Diez
<marcos@unitron.com.br>):

> Marcos Diez wrote:

>> In a Unix desktop system automount is very practical for CDROMs, 
>> digital cameras, USB flash drives and any other type of removable
media.
>> But it is annoying to the unprivileged user to wait the timeout to 
>> remove the media.

> It seems to me that a better architected solution might be to tie in
the automounter with the eject(1) sort of command.

> It is not good for a user to have to know that he needs to zing the
automounter in order to remove his media.

>    Thanx...
>       ps

 So, perhaps we could send a patch to the maintainer of the eject
utility.  It could detect if the target is
 under an autofs and use this code in place of the ioctl() that it would
normally send to a CD-ROM or similar
 device.

 On my OpenSuSE system eject is already marked SUID/root, though it
doesn't seem the be the case for my RHEL4
 system nor on my Debian system.

 As usual I'd limit the risk of another SUID/root binary by marking the
executable mode 4550 and associating
 it with some relevant group (such as "console").  Thus only processes
running in the specified group can attempt
 to exploit any vulnerabilities in it.

 Question: how would one programmatically detect that a particular mount
point is being managed by an autofs process?

JDennis

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: nonroot umount
  2006-07-11 22:56 nonroot umount Jim Dennis
@ 2006-07-11 23:12 ` Jeff Moyer
  0 siblings, 0 replies; 6+ messages in thread
From: Jeff Moyer @ 2006-07-11 23:12 UTC (permalink / raw)
  To: Jim Dennis; +Cc: autofs

==> Regarding Re: [autofs] nonroot umount; "Jim Dennis" <jdennis@cadence.com> adds:

jdennis> On Date: Tue, 11 Jul 2006 08:39:01 -0400
jdennis> Peter Staubach <staubach@redhat.com> wrote (in response to Marcos Diez
jdennis> <marcos@unitron.com.br>):

>> Marcos Diez wrote:

>>> In a Unix desktop system automount is very practical for CDROMs, 
>>> digital cameras, USB flash drives and any other type of removable
jdennis> media.
>>> But it is annoying to the unprivileged user to wait the timeout to 
>>> remove the media.

>> It seems to me that a better architected solution might be to tie in
jdennis> the automounter with the eject(1) sort of command.

>> It is not good for a user to have to know that he needs to zing the
jdennis> automounter in order to remove his media.

>> Thanx...
>> ps

jdennis>  So, perhaps we could send a patch to the maintainer of the eject
jdennis> utility.  It could detect if the target is
jdennis>  under an autofs and use this code in place of the ioctl() that it would
jdennis> normally send to a CD-ROM or similar
jdennis>  device.

jdennis>  On my OpenSuSE system eject is already marked SUID/root, though it
jdennis> doesn't seem the be the case for my RHEL4
jdennis>  system nor on my Debian system.

jdennis>  As usual I'd limit the risk of another SUID/root binary by marking the
jdennis> executable mode 4550 and associating
jdennis>  it with some relevant group (such as "console").  Thus only processes
jdennis> running in the specified group can attempt
jdennis>  to exploit any vulnerabilities in it.

jdennis>  Question: how would one programmatically detect that a particular
jdennis> mount point is being managed by an autofs process?

I simply don't like this idea.  ;)  As I mentioned before, there are better
mechanisms to deal with removable media.

If, however, you insist on using the automounter for this, then why not
specify a short timeout for removable media?  Put all forms of removable
media in the same map, and use --timeout=1 or 5, or 10, whatever suits
you.  Would that be an acceptable solution?

-Jeff

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-07-11 23:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-11 22:56 nonroot umount Jim Dennis
2006-07-11 23:12 ` Jeff Moyer
     [not found] <200607100726.k6A7Po1e029994@hera.kernel.org>
2006-07-10 23:26 ` Marcos Diez
2006-07-11 12:39   ` Peter Staubach
2006-07-11 13:47     ` Jeff Moyer
2006-07-11 14:09       ` Peter Staubach

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.