MFC r349800,r349801:
Fix misc fs fuzzing issues.
Reported by: Christopher Krah, Thomas Barabosch, and Jan-Niclas Hilgert of Fraunhofer FKIE
Reported as: FS-22-EXT2-9: Denial of service in ftruncate-0 (ext2_balloc)
FS-11-EXT2-6: Denial Of Service in write-1 (ext2_balloc)
Add additional check for 'blocks per group' and 'fragments per group' superblock fields.
These fields will not be equal only in case if bigalloc filesystem feature is turned on.
This feature is not supported for now.
Reported by: Christopher Krah, Thomas Barabosch, and Jan-Niclas Hilgert of Fraunhofer FKIE
Reported as: FS-27-EXT2-12: Denial of Service in openat-0 (vm_fault_hold/ext2_clusteracct)
MFC after: 2 weeks
Remove ufs fragments logic.
The ext2fs fragments are different from ufs fragments.
In case of ext2fs the fragment should be equal or more then block size.
The values more than block size are used only in case of bigalloc feature, which is does not supported for now.
Reported by: Christopher Krah, Thomas Barabosch, and Jan-Niclas Hilgert of Fraunhofer FKIE
Reported as: FS-22-EXT2-9: Denial of service in ftruncate-0 (ext2_balloc)
MFC after: 2 weeks
Remove unneeded mount point unlock call.
Reported by: Christopher Krah, Thomas Barabosch, and Jan-Niclas Hilgert of Fraunhofer FKIE
Reported as: FS-11-EXT2-6: Denial Of Service in write-1 (ext2_balloc)
MFC after: 2 weeks
MFC r346267, 346269:
ext2fs: Initial version of DTrace support.
Reviewed by: pfg, gnn
Differential Revision: https://reviews.freebsd.org/D19848
ext2fs: Initial version of DTrace support.
Commit forgotten file.
Reviewed by: pfg, gnn
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D19848
ext2fs: Initial version of DTrace support.
Reviewed by: pfg, gnn
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D19848
MFC: r344757:
Fix double free in case of mount error.
Reported by: Christopher Krah, Thomas Barabosch, and Jan-Niclas Hilgert of Fraunhofer FKIE
Reported as: FS-9-EXT3-2: Denial Of Service in nmount-5 (vm_fault_hold)
Reviewed by: pfg
Differential Revision: https://reviews.freebsd.org/D19385
MFC: r344752:
Add additional on-disk inode checks.
Reviewed by: pfg
Differential Revision: https://reviews.freebsd.org/D19323
MFC: r344754:
Do not panic if inode bitmap is corrupted.
admbug: 804
Reported by: Ilja Van Sprundel
Reviewed by: pfg
Differential Revision: https://reviews.freebsd.org/D19325
MFC: r344756, r345179:
Do not read the on-disk inode in case of vnode allocation.
Reported by: Christopher Krah, Thomas Barabosch, and Jan-Niclas Hilgert of Fraunhofer FKIE
Reported as: FS-6-EXT2-4: Denial Of Service in mkdir-0 (ext2_mkdir/vn_rdwr)
Reviewed by: pfg
Differential Revision: https://reviews.freebsd.org/D19327
MFC: r344755:
Fix integer overflow possibility.
Reported by: Christopher Krah, Thomas Barabosch, and Jan-Niclas Hilgert of Fraunhofer FKIE
Reported as: FS-2-EXT2-1: Out-of-Bounds Write in nmount (ext2_vget)
Reviewed by: pfg
Differential Revision: https://reviews.freebsd.org/D19326
MFC: r344753:
Validate block bitmaps.
Reviewed by: pfg
Differential Revision: https://reviews.freebsd.org/D19324
MFC r344751:
Make superblock reading logic more strict.
Add more on-disk superblock consistency checks to ext2_compute_sb_data() function.
It should decrease the probability of mounting filesystems with corrupted superblock data.
Reviewed by: pfg
Differential Revision: https://reviews.freebsd.org/D19322
Remove unneeded mount point unlock function calls.
The ext2_nodealloccg() function unlocks the mount point
in case of successful node allocation.
The additional unlocks are not required and should be removed.
PR: 236452
Reported by: pho
MFC after: 3 days
Fix double free in case of mount error.
Reported by: Christopher Krah <krah at protonmail.com>
Reported as: FS-9-EXT3-2: Denial Of Service in nmount-5 (vm_fault_hold)
Reviewed by: pfg
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D19385
Do not read the on-disk inode in case of vnode allocation.
Reported by: Christopher Krah <krah at protonmail.com>
Reported as: FS-6-EXT2-4: Denial Of Service in mkdir-0 (ext2_mkdir/vn_rdwr)
Reviewed by: pfg
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D19327
Fix integer overflow possibility.
Reported by: Christopher Krah <krah at protonmail.com>
Reported as: FS-2-EXT2-1: Out-of-Bounds Write in nmount (ext2_vget)
Reviewed by: pfg
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D19326
Do not panic if inode bitmap is corrupted.
admbug: 804
Reported by: Ilja Van Sprundel <ivansprundel at ioactive.com>
Reviewed by: pfg
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D19325
Validate block bitmaps.
Reviewed by: pfg
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D19324
Add additional on-disk inode checks.
Reviewed by: pfg
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D19323
Make superblock reading logic more strict.
Add more on-disk superblock consistency checks to ext2_compute_sb_data() function.
It should decrease the probability of mounting filesystems with corrupted superblock data.
Reviewed by: pfg
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D19322
MFC r342933:
Fix errno values returned from DUMMY_XATTR linuxulator calls
Reported by: weiss at uni-mainz.de
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D18812
Fix errno values returned from DUMMY_XATTR linuxulator calls
Reported by: weiss at uni-mainz.de
Reviewed by: markj
MFC after: 1 day
Differential Revision: https://reviews.freebsd.org/D18812
FUSE extattrs: fix issue when neither uio nor size were not passed to VOP_* (cosmetic only).
Reviewed by: cem, pfg
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D13737
FUSE extattrs: fix issue when neither uio nor size were not passed to VOP_*.
The requested size was returned incorrectly in case uio == NULL from listextattr because the
nameprefix/name conversion was not applied.
Also, make a_size/uio returning logic more unified with other filesystems.
Reviewed by: cem, pfg
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D13528
Change unused inodes counters behavior in the cylinder groups.
Make it more close to native ext4 implementation to avoid fsck errors.
Fix directory blocks checksum updating logic.
Count dirent tail in the searchslot logic in case of directory block search.
Add htree root csum update function call in case of rename.
Split the dir_index and dir_nlink features.
Do not allow to create more that EXT4_LINK_MAX links to directory in case
if the dir_nlink is not set, like it is done in the fresh e2fsprogs updates.
MFC after: 3 months
Fix directory blocks checksum updating logic.
The checksum updating functions were not called in case of dir index inode splitting
and in case of dir entry removing, when the entry was first in the block.
Fix and move the dir entry adding logic when i_count == 0 to new function.
MFC after: 3 months