• Darrick J. Wong's avatar
    xfs: transfer recovered intent item ownership in ->iop_recover · deb4cd8b
    Darrick J. Wong authored
    Now that we pass the xfs_defer_pending object into the intent item
    recovery functions, we know exactly when ownership of the sole refcount
    passes from the recovery context to the intent done item.  At that
    point, we need to null out dfp_intent so that the recovery mechanism
    won't release it.  This should fix the UAF problem reported by Long Li.
    
    Note that we still want to recreate the full deferred work state.  That
    will be addressed in the next patches.
    
    Fixes: 2e76f188 ("xfs: cancel intents immediately if process_intents fails")
    Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
    Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
    deb4cd8b
xfs_extfree_item.c 24.3 KB