• D
    [XFS] Prevent use-after-free caused by synchronous inode reclaim · 99fa8cb3
    David Chinner 提交于
    With the combined linux and XFS inode, we need to ensure that the combined
    structure is not freed before the generic code is finished with the inode.
    As it turns out, there is a case where the XFS inode is freed before the
    linux inode - when xfs_reclaim() is called from ->clear_inode() on a clean
    inode, the xfs inode is freed during that call. The generic code
    references the inode after the ->clear_inode() call, so this is a use
    after free situation.
    
    Fix the problem by moving the xfs_reclaim() call to ->destroy_inode()
    instead of in ->clear_inode(). This ensures the combined inode structure
    is not freed until after the generic code has finished with it.
    
    SGI-PV: 988141
    
    SGI-Modid: xfs-linux-melb:xfs-kern:32324a
    Signed-off-by: NDavid Chinner <david@fromorbit.com>
    Signed-off-by: NLachlan McIlroy <lachlan@sgi.com>
    Signed-off-by: NChristoph Hellwig <hch@infradead.org>
    99fa8cb3
xfs_super.c 52.0 KB