xfs: Add test for CVE-2017-14340
authorRichard Wareing <rwareing@fb.com>
Fri, 22 Sep 2017 02:34:46 +0000 (19:34 -0700)
committerEryu Guan <eguan@redhat.com>
Sun, 24 Sep 2017 16:14:00 +0000 (00:14 +0800)
commitea817058b0bc1ef5a9ddc0a74ddf3482ec265f8a
tree607dfc6b2c394b018f693b85c4458598f32d73a2
parenta21f34f87f8e770fa53a564a8176c878eb78cc00
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>
tests/xfs/431 [new file with mode: 0755]
tests/xfs/431.out [new file with mode: 0644]
tests/xfs/group