• M
    [PATCH] fuse: account background requests · 08a53cdc
    Miklos Szeredi 提交于
    The previous patch removed limiting the number of outstanding requests.  This
    patch adds a much simpler limiting, that is also compatible with file locking
    operations.
    
    A task may have at most one synchronous request allocated.  So these requests
    need not be otherwise limited.
    
    However the number of background requests (release, forget, asynchronous
    reads, interrupted requests) can grow indefinitely.  This can be used by a
    malicous user to cause FUSE to allocate arbitrary amounts of unswappable
    kernel memory, denying service.
    
    For this reason add a limit for the number of background requests, and block
    allocations of new requests until the number goes bellow the limit.
    
    Also use this mechanism to block all requests until the INIT reply is
    received.
    Signed-off-by: NMiklos Szeredi <miklos@szeredi.hu>
    Signed-off-by: NAndrew Morton <akpm@osdl.org>
    Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
    08a53cdc
dev.c 23.4 KB