xfs: Add test for CVE-2017-14340
Verify kernel doesn't panic when user attempts to set realtime flags
on non-realtime FS, using kernel compiled with CONFIG_XFS_RT.
Unpatched kernels will panic during this test. Kernels not compiled
with CONFIG_XFS_RT should pass test.
This bug was fixed via commit
b31ff3cdf540 ("xfs:
XFS_IS_REALTIME_INODE() should be false if no rt device present") on
the main kernel tree.
[eguan: don't assume fixed position when grepping 't' and add some
comments about why we do this, also remove testfile after test]
Signed-off-by: Richard Wareing <rwareing@fb.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>