Re: DoS with POSIX file locks?

Miklos Szeredi
2006-03-20T12:52:54Z

> Right. Um. I took it out back in March 2003 after enough people
> convinced me it wasn't worth trying to account for all the memory
> processes use, and the userbeans project would take care of it anyway.
> Haha.
>
> It's hard to fix the accounting. You have to deal with one thread
> allocating the lock, and then a different thread freeing it. We never
> actually accounted for posix locks (which are the ones we really needed
> to!) and on occasion had current->locks go negative, with all kinds of
> associated badness.

Things look fairly straightforward if the accounting is done in
files_struct instead of task_struct. At least for POSIX locks. I
haven't looked at flocks or leases yet.

steal_locks() might cause problems, but that function should be gotten
rid of anyway.

Miklos