Craft a malicious filesystem image with a negative inode size,
then try to trigger a kernel DoS by appending data to the file.
Ideally this should trigger verifier errors instead of hanging.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Now that these tests have been made generic, move them into the
generic/ dir and update group files.
xfs/133 -> generic/383
xfs/134 -> generic/384
xfs/196 -> generic/385
xfs/262 -> generic/386
Signed-off-by: Eryu Guan <eguan@redhat.com>
This patch makes some xfs project quota tests generic,
so that there is at least some coverage on ext4 for this
(semi-)new feature.
It requires bleeding edge xfsprogs, so that xfs_quota and
xfs_io's chproj command can operate on "foreign" filesystems,
and requires relatively new e2fsprogs to enable the project
quota feature on-disk.
The mechanism for enabling project quota on ext4 is a bit
arcane, but hopefully I've encapsulated it reasonably well here.
Changes:
* look for "project" feature in _require_prjquota
* look for accounting not enforcement (-P) in _require_prjquota
* add a _scratch_enable_pquota to turn on project quota feature
* s/pquota/quota/ in _qmount_option for ext4
* add helper to test for xfs_io chproj on foreign filesystems
* switch from block to inode quota in xfs/133 because empty
ext4 dirs consume one block
* cosmetic/generic changes for mkfs, require tests, etc.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
xfs/133 and xfs/138 use too much code to do "return value" check,
it's not necessary. For the code can be more readable and clear,
I change "return value" check to golden image check.
Signed-off-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
There's a known bug of xfsprogs, when a project name beinning with
digits, it can't be found by run xfs_quota 'quota -p -v ...' command.
Signed-off-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>