mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Trond Myklebust <trond.myklebust@fys.uio.no>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: chrisw@sous-sol.org, matthew@wil.cx,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: DoS with POSIX file locks?
Date: Wed, 22 Mar 2006 15:07:57 -0500	[thread overview]
Message-ID: <1143058078.8929.21.camel@lade.trondhjem.org> (raw)
In-Reply-To: <E1FM6Hd-0001l9-00@dorka.pomaz.szeredi.hu>

On Wed, 2006-03-22 at 17:34 +0100, Miklos Szeredi wrote:

> You mean the "local lockowner being stable" is irrelevant.
> 
> Yes that is true, but the patch not only makes the local lockowner
> stable, it makes the "owner" stable.  And that is the important part
> for NFS, etc.
> 
> The remote lockowner has to be derived from the owner, which used to
> be current->files, but is changed to current->file->owner.
> 
> The fact that current->file->owner will remain stable across the exec
> will mean that locking will behave consistently for local _and_ remote
> filesystems.
> 
> Now I'm not saying I want to keep this weird semantics of always
> inheriting locks on exec.  All I'm saying that it's _possible_.

You'd have to ensure that none of the threads involved are able to grab
new posix locks in the period between the unsharing of current->files to
the moment when current->files->owner is swapped.

If not, one thread could in theory open a new file and grab a lock that
can never be unlocked because its lockowner gets stolen away from it by
another execing thread.

Cheers,
  Trond


  reply	other threads:[~2006-03-22 20:08 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-20 11:41 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
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 [this message]
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=1143058078.8929.21.camel@lade.trondhjem.org \
    --to=trond.myklebust@fys.uio.no \
    --cc=chrisw@sous-sol.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthew@wil.cx \
    --cc=miklos@szeredi.hu \
    /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

all inboxes | Powered by JetHome®