• Stephen D. Smalley's avatar
    [PATCH] allocate and free security structures for private files · 66a67557
    Stephen D. Smalley authored
    This patch adds a security_file_alloc call to init_private_file and
    creates a close_private_file function to encapsulate the release of
    private file structures.  These changes ensure that security
    structures for private files will be allocated and freed
    appropriately.  Per Andi Kleen's comments, the patch also renames
    init_private_file to open_private_file to force updating of all
    callers, since they will also need to be updated to use
    close_private_file to avoid a leak of the security structure.  Per
    Christoph Hellwig's comments, the patch also replaces the 'mode'
    argument with a 'flags' argument, computing the f_mode from the flags,
    and it explicitly tests f_op prior to dereferencing, as in
    dentry_open().
    66a67557
expfs.c 14.3 KB