xfs: filestream allocator inode use-after-free test

The XFS filestreams allocator caches dir inode -> agno mappings in
an MRU mechanism that holds elements in memory for an amount of time
and then cleans up expired elements in the background. The elements
typically held inode pointers without holding a reference to the
associated inode. This means that if the inode is reclaimed before
an expired entry is cleaned up, the MRU reaper can access freed
memory and cause a panic.

Test for this problem by performing continuous filestreams
allocations under short-lived parent directory inodes. This will
produce KASAN use-after-free splats if enabled during the test.

Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
This commit is contained in:
Brian Foster
2018-04-26 08:04:44 -04:00
committed by Eryu Guan
parent e46a9aa0be
commit 91481af949
4 changed files with 122 additions and 0 deletions
+1
View File
@@ -442,3 +442,4 @@
442 auto stress clone quota
443 auto quick ioctl fsr
444 auto quick
445 auto quick filestreams