mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Trond Myklebust <trond.myklebust@fys.uio.no>
To: Chris Wright <chrisw@osdl.org>
Cc: Avi Kivity <avi@argo.co.il>, linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: local denial-of-service with file leases
Date: Fri, 11 Nov 2005 09:21:26 -0500	[thread overview]
Message-ID: <1131718887.8805.33.camel@lade.trondhjem.org> (raw)
In-Reply-To: <20051111084554.GZ7991@shell0.pdx.osdl.net>

[-- Attachment #1: Type: text/plain, Size: 562 bytes --]

On Fri, 2005-11-11 at 00:45 -0800, Chris Wright wrote:
> * Avi Kivity (avi@argo.co.il) wrote:
> > the following program will oom a the 2.6.14.1 kernel, running as an 
> > ordinary user:
> 
> I don't have a good mechanism for testing leases, but this should fix
> the leak.  Mind testing?
> 

Bruce has a simpler patch (see attachment). The call to fasync_helper()
in order to free active structures will have already been done in
locks_delete_lock(), so in principle, all we want to do is to skip the
fasync_helper() call in fcntl_setlease().

Cheers,
  Trond



[-- Attachment #2: Attached message - Re: [Fwd: local denial-of-service with file leases] --]
[-- Type: message/rfc822, Size: 2870 bytes --]

From: "J. Bruce Fields" <bfields@fieldses.org>
To: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: "William A (Andy) Adamson" <andros@umich.edu>
Subject: Re: [Fwd: local denial-of-service with file leases]
Date: Thu, 10 Nov 2005 19:08:00 -0500
Message-ID: <20051111000800.GE31168@fieldses.org>

On Thu, Nov 10, 2005 at 05:54:28PM -0500, bfields wrote:
> Sorry, that should ahve been an obvious thing to try after that last
> complaint.  OK, looking....

Yup:

http://linux.bkbits.net:8080/linux-2.6/diffs/fs/locks.c@1.70?nav=index.html|src/|src/fs|hist/fs/locks.c

(Isn't there someone with a complete kernel history in git and a gitweb
interface?  Sure would be convenient.)

This seems to fix it, but I want to investigate a little more tommorow.
--b.


---

 linux-2.6.14-bfields/fs/locks.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN fs/locks.c~locks-fix-fasync-leak fs/locks.c
--- linux-2.6.14/fs/locks.c~locks-fix-fasync-leak	2005-11-10 18:49:15.000000000 -0500
+++ linux-2.6.14-bfields/fs/locks.c	2005-11-10 18:50:12.000000000 -0500
@@ -1446,7 +1446,7 @@ int fcntl_setlease(unsigned int fd, stru
 	lock_kernel();
 
 	error = __setlease(filp, arg, &flp);
-	if (error)
+	if (error || arg == F_UNLCK)
 		goto out_unlock;
 
 	error = fasync_helper(fd, filp, 1, &flp->fl_fasync);
_

  parent reply	other threads:[~2005-11-11 14:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-10 17:00 Avi Kivity
2005-11-11  8:45 ` Chris Wright
2005-11-11 10:05   ` Avi Kivity
2005-11-11 11:14     ` Avi Kivity
2005-11-11 14:21   ` Trond Myklebust [this message]
2005-11-11 18:35     ` Chris Wright
2005-11-11 19:25       ` Trond Myklebust
2005-11-12  1:20         ` Chris Wright
2005-11-13  9:05           ` Avi Kivity

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=1131718887.8805.33.camel@lade.trondhjem.org \
    --to=trond.myklebust@fys.uio.no \
    --cc=avi@argo.co.il \
    --cc=chrisw@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    /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®