Skip to content

Commit

Permalink
[XFS] Fix use after free in xfs_log_done().
Browse files Browse the repository at this point in the history
The ticket allocation code got reworked in 2.6.26 and we now free tickets
whereas before we used to cache them so the use-after-free went
undetected.

SGI-PV: 985525

SGI-Modid: xfs-linux-melb:xfs-kern:31877a

Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Signed-off-by: David Chinner <david@fromorbit.com>
  • Loading branch information
Lachlan McIlroy authored and Lachlan McIlroy committed Aug 13, 2008
1 parent c94312d commit c6a7b0f
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions fs/xfs/xfs_log.c
Original file line number Diff line number Diff line change
Expand Up @@ -336,15 +336,12 @@ xfs_log_done(xfs_mount_t *mp,
} else {
xlog_trace_loggrant(log, ticket, "xfs_log_done: (permanent)");
xlog_regrant_reserve_log_space(log, ticket);
}

/* If this ticket was a permanent reservation and we aren't
* trying to release it, reset the inited flags; so next time
* we write, a start record will be written out.
*/
if ((ticket->t_flags & XLOG_TIC_PERM_RESERV) &&
(flags & XFS_LOG_REL_PERM_RESERV) == 0)
/* If this ticket was a permanent reservation and we aren't
* trying to release it, reset the inited flags; so next time
* we write, a start record will be written out.
*/
ticket->t_flags |= XLOG_TIC_INITED;
}

return lsn;
} /* xfs_log_done */
Expand Down

0 comments on commit c6a7b0f

Please sign in to comment.