linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Miklos Szeredi <miklos@szeredi.hu>
To: bfields@fieldses.org
Cc: matthew@wil.cx, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: DoS with POSIX file locks?
Date: Tue, 21 Mar 2006 07:38:56 +0100	[thread overview]
Message-ID: <E1FLaW8-0001hD-00@dorka.pomaz.szeredi.hu> (raw)
In-Reply-To: <20060320203556.GC31512@fieldses.org> (bfields@fieldses.org)

> > > > 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.
> > > 
> > > I was thinking that would work, yes.  It might not be worth worrying
> > > about accounting for leases/flocks since each process can only have one
> > > of those per open file anyway.
> > 
> > Here's a minimally tested patch.  The only tricky part is when the
> > unlock splits an existing lock in two.
> > 
> > Also the limit checking is sloppy when the lock is split, and in that
> > case allows the counter to go one above the limit.
> 
> Do you need to handle blocks as well as applied locks?

I don't think so, because each task may only have at most one block at
a time.

Miklos

  reply	other threads:[~2006-03-21  6:39 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-20 11:41 DoS with POSIX file locks? Miklos Szeredi
2006-03-20 12:11 ` Matthew Wilcox
2006-03-20 12:19   ` Miklos Szeredi
2006-03-20 12:39     ` Matthew Wilcox
2006-03-20 12:52       ` Miklos Szeredi
2006-03-20 13:13         ` Arjan van de Ven
2006-03-20 13:24           ` Miklos Szeredi
2006-03-20 13:30             ` Arjan van de Ven
2006-03-20 13:39               ` Miklos Szeredi
2006-03-20 15:32         ` Matthew Wilcox
2006-03-20 16:41           ` Miklos Szeredi
2006-03-20 20:35             ` J. Bruce Fields
2006-03-21  6:38               ` Miklos Szeredi [this message]
2006-03-20 18:22           ` Trond Myklebust
2006-03-21  9:44             ` Miklos Szeredi
2006-03-21 17:28               ` Trond Myklebust
2006-03-21 17:58                 ` Miklos Szeredi
2006-03-21 18:16                   ` Trond Myklebust
2006-03-21 19:16                   ` Chris Wright
2006-03-22  6:21                     ` Miklos Szeredi
2006-03-22 11:12                       ` Trond Myklebust
2006-03-22 12:16                         ` Miklos Szeredi
2006-03-22 15:56                           ` Trond Myklebust
2006-03-22 16:34                             ` Miklos Szeredi
2006-03-22 20:07                               ` Trond Myklebust
2006-03-22 20:19                                 ` Miklos Szeredi

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=E1FLaW8-0001hD-00@dorka.pomaz.szeredi.hu \
    --to=miklos@szeredi.hu \
    --cc=bfields@fieldses.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthew@wil.cx \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).