Re: Advisory file locking support?
- From: Corinna Vinschen <corinna@xxxxxxxxxxxxxxxx>
- Date: Tue, 18 Mar 2008 11:53:43 +0000 (UTC)
Hi Johannes,
Johannes Passing wrote:
Corinna Vinschen wrote:
Hmm, how likely is that? The advisory file locking is a cooperativeCertainly not by accident, no. But say some process (server or whatever)
effort anyway. The object names are using subdirs in the global
namespace which you can't create using Win32 functions, so it's
unlikely that a normal Win32 process will ever accidentally create
such an object name.
uses advisory locking. Any malicious program, even if running as a
restricted user, in a different session and not having access to the
respective files, can create those lock objects and trick the server.
Eventually, this might lead to the server blocking forever for those
locks to be released. Yes, it is unlikely, but I'd still consider it a
security risk. And the fact that there is no Win32 equivalent for
NtCreateDirectoryObject etc is hardly a protection... I do not know the
exact semantics POSIX requires, but I assume a process using advisory
locking may expect not to be subject to such DoS issues.
I didn't consider NtCreateDirectoryObject a protection against a
malicious application, just a protection against accidental creation of
such an object from Win32 apps. Still, a malicious application which
would use this advisory locking mechanism would have some problems:
- It would be malicious only to Cygwin processes, not to native Win32
processes or the machine as a whole.
- The locking objects only exist as long as some process has an open
handle to it. To be effective, the malicious application has to keep
running and as such is identifiable.
- It would have to know that certain files are subject to advisory
file locking.
- It would have to know that certain PIDs are Cygwin processes.
- It would have to copy the whole naming scheme to create object names
recognized as valid locking objects.
- If it's a Cygwin application using fcntl in a malicious way, it's
not different from any other POSIX applications doing mischief.
All in all, I can see much easier and much more efficient mechanisms
to create a DoS attack.
For instance, locking a file using LockFileEx is much more efficient
and has much more effect than to hack an advisory file locking scheme
used by some non-system DLL. IMHO.
Corinna
--
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat
.
- Follow-Ups:
- Re: Advisory file locking support?
- From: Johannes Passing
- Re: Advisory file locking support?
- References:
- Advisory file locking support?
- From: Corinna Vinschen
- RE: Advisory file locking support?
- From: Jialiang Ge [MSFT]
- Re: Advisory file locking support?
- From: Corinna Vinschen
- Re: Advisory file locking support?
- From: Johannes Passing
- Re: Advisory file locking support?
- From: Corinna Vinschen
- Re: Advisory file locking support?
- From: Johannes Passing
- Re: Advisory file locking support?
- From: Corinna Vinschen
- Re: Advisory file locking support?
- From: Johannes Passing
- Advisory file locking support?
- Prev by Date: Re: Advisory file locking support?
- Next by Date: Re: Advisory file locking support?
- Previous by thread: Re: Advisory file locking support?
- Next by thread: Re: Advisory file locking support?
- Index(es):
Relevant Pages
|