Re: [RFC/PATCH] revoke/frevoke system calls V2



On Mon, 7 Aug 2006, Edgar Toernig wrote:


Your implementation is much cruder - it simply takes the fd
away from the app; any future use gives EBADF. As a bonus,
it works for regular files and even goes as far as destroying
all mappings of the file from all processes (even root processes).
IMVHO this is a disaster from a security and reliability point
of view.


I can see the value in these system calls, but I agree that the implementation is crude. "EBADF" is not something that applications are taught to expect. Someone correct me if I'm wrong, but I can think of no situation under which a file descriptor currently gets yanked out from under your feet -- you should always have to formally abandon it with close().

This kind of thing only looks proper if it leaves the file descriptor in place and just returns errors / EOF when you attempt to access it.

Thanks,
Chase
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: Solaris 10 - catman weird error
    ... DTrace can absolutely help in this situation. ... returns EIO or EBADF: ... probably want to know _how_ exactly the file descriptor was closed. ... that you know the process ID of the problematic process, here is a D script ...
    (comp.unix.solaris)
  • Possible error in Beejs guide to IPC document
    ... My query is for Unix IPC. ... I think he meant to say fcntl() will return EBADF. ... accept the path and returns a file descriptor which we input to fcntl ...
    (comp.unix.programmer)
  • Re: close() on a closed file descriptor in Visual Studio 8
    ... returns EBADF and everybody goes on with their lives. ... In Visual Studio ... just goes through the file descriptor table and closes them all (pretty ... as described in Parameter Validation. ...
    (microsoft.public.vc.language)
  • Re: Bad file descriptor error
    ... It may mean that google has summarily hung up on you. ... EBADF occurs, if the file descriptor is invalid. ...
    (comp.lang.ruby)
  • Re: [RFC/PATCH] revoke/frevoke system calls V2
    ... Ar Llu, 2006-08-07 am 22:41 +0200, ysgrifennodd Edgar Toernig: ... > away from the app; any future use gives EBADF. ... As a bonus, ...
    (Linux-Kernel)