Brian Foster 4d09807f20 xfs: fix use after free in buf log item unlock assert
The xfs_buf_log_item ->iop_unlock() callback asserts that the buffer
is unlocked when either non-stale or aborted. This assert occurs
after the bli refcount has been dropped and the log item potentially
freed. The aborted check is thus a potential use after free. This
problem has been reproduced with KASAN enabled via generic/475.

Fix up xfs_buf_item_unlock() to query aborted state before the bli
reference is dropped to prevent a potential use after free.

Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
2019-04-14 18:15:56 -07:00
..
2018-06-06 14:17:53 -07:00
2018-06-06 14:17:53 -07:00
2018-06-06 14:17:53 -07:00
2018-06-06 14:17:53 -07:00
2018-06-06 14:17:53 -07:00
2019-03-08 14:12:17 -08:00
2018-06-06 14:17:53 -07:00
2018-06-06 14:17:53 -07:00
2018-06-06 14:17:53 -07:00
2018-06-06 14:17:53 -07:00
2018-06-06 14:17:53 -07:00
2018-07-30 07:57:48 -07:00
2018-06-06 14:17:53 -07:00
2018-06-06 14:17:53 -07:00
2018-06-06 14:17:53 -07:00
2018-08-01 07:40:48 -07:00
2019-02-21 07:55:07 -08:00
2018-07-26 10:15:16 -07:00
2018-06-06 14:17:53 -07:00
2018-06-06 14:17:53 -07:00
2019-02-21 07:55:07 -08:00
2018-06-06 14:17:53 -07:00
2018-06-06 14:17:53 -07:00
2019-02-21 07:55:07 -08:00
2019-02-21 07:55:07 -08:00
2018-06-06 14:17:53 -07:00
2018-06-06 14:17:53 -07:00