Commit graph

555 commits

Author SHA1 Message Date
Andrei Borzenkov
edc94e4b0b fs/hfsplus: fix memory leak.
Found by: Coverity scan.
2015-01-27 21:19:28 +03:00
Andrei Borzenkov
3900726fa8 fs/zfs/zfscrypt.c: fix indentation. 2015-01-27 21:13:10 +03:00
Andrei Borzenkov
fa13e60527 fs/zfs/zfscrypt.c: fix memory leaks.
Found by: Coverity scan.
2015-01-27 21:12:19 +03:00
Andrei Borzenkov
e871994849 fs/zfs/zfs.c: fix memory leak.
Found by: Coverity scan.
2015-01-27 20:52:27 +03:00
Vladimir Serbinenko
9ee5ae1fae Document intentional fallthroughs.
Found by: Coverity scan.
2015-01-27 17:17:58 +01:00
Vladimir Serbinenko
916733ea6a fs/zfscrypt: Add missing explicit cast.
Found by: Coverity scan.
2015-01-27 16:35:37 +01:00
Vladimir Serbinenko
0daf46fdbd fs/zfs: Fix error handling.
Found by: Coverity Scan.
2015-01-27 16:32:21 +01:00
Vladimir Serbinenko
69a52e95d4 fs/{cbfs,cpio}: Remove useless check if mode is NULL.
Callers already ensure that it's not null.

Found by: Coverity Scan.
2015-01-27 16:32:21 +01:00
Vladimir Serbinenko
a4e33a8b18 fs/ufs: Add missing error check.
Found by: Coverity scan.
2015-01-26 09:36:19 +01:00
Vladimir Serbinenko
66baeffc0f fs/sfs: Fix error check and add sanity check.
Found by: Coverity scan.
2015-01-25 20:32:31 +01:00
Vladimir Serbinenko
8c1d086689 fs/reiserfs: Fix sector count overflow.
Found by: Coverity scan.
2015-01-25 20:32:31 +01:00
Vladimir Serbinenko
157f9a9cca fs/ntfs: Add sizes sanity checks.
Found by: Coverity scan.
2015-01-25 20:32:31 +01:00
Vladimir Serbinenko
bc0ecd7104 fs/ntfs: Add missing free.
Found by: Coverity scan.
2015-01-25 20:32:31 +01:00
Vladimir Serbinenko
ca793e9c05 fs/minix: Fix sector promotion to 64-bit.
While on it make GRUB_MINIX_ZONE2SECT into function.

Found by: Coverity scan
2015-01-25 20:32:31 +01:00
Vladimir Serbinenko
ac602ce700 grub_iso9660_read: Explicitly check read_node return value.
Not really needed as grub_errno is already checked but is nicer.

Found by: Coverity scan.
2015-01-25 20:32:31 +01:00
Vladimir Serbinenko
d0af2156c3 fs/hfs: Add pointer sanity checks.
Found by: Coverity scan.
2015-01-25 13:18:10 +01:00
Vladimir Serbinenko
4387ca78f0 fs/hfs/hfs_open: Check that mount succeeded.
Found by: Coverity scan.
2015-01-25 01:28:17 +01:00
Vladimir Serbinenko
83543f937a fs/fat: Fix codepath to properly free on error.
Found by: Coverity scan.
2015-01-25 01:27:44 +01:00
Vladimir Serbinenko
faad548ce3 fs/cpio_common: Add a sanity check on namesize.
Found by: Coverity scan.
2015-01-25 00:11:59 +01:00
Vladimir Serbinenko
b6f21bcb98 fs/cbfs: Add missing free.
Found by: Coverity scan.
2015-01-25 00:00:49 +01:00
Vladimir Serbinenko
12a9c52e51 zfs: Fix disk-matching logic.
Reported by: Tim Chase <dweeezil>
2015-01-24 20:57:26 +01:00
Vladimir Serbinenko
475bffeae6 * grub-core/fs/zfs.c: Avoid divisions by zero. 2015-01-21 17:42:12 +01:00
Vladimir Serbinenko
9deb46e363 * grub-core/fs/btrfs.c: Avoid divisions by zero. 2015-01-21 17:42:12 +01:00
Vladimir Serbinenko
98f74998d5 * grub-core/fs/hfs.c (grub_hfs_mount): Additional filesystem sanity checks. 2015-01-21 17:42:11 +01:00
Vladimir Serbinenko
5ed3a5d049 * grub-core/fs/minix.c: Additional filesystem sanity checks. 2015-01-21 17:42:11 +01:00
Vladimir Serbinenko
47cd2645dd * grub-core/fs/ext2.c (grub_ext2_mount): Additional checks for superblock validity. 2015-01-21 17:42:11 +01:00
Vladimir Serbinenko
245e21b2b5 grub_ufs_mount: Check that sblock.ino_per_group is not 0. 2015-01-21 17:42:11 +01:00
Vladimir Serbinenko
9201cd79a3 Reject NILFS2 superblocks with over 1GiB blocks.
* grub-core/fs/nilfs2.c (grub_nilfs2_valid_sb): Check that
	block size is <= 1GiB.
2015-01-21 17:42:10 +01:00
Vladimir Serbinenko
30e177a05b grub-core/fs/minix.c (grub_minix_read_file): Avoid reading past the end of file. 2015-01-21 17:42:06 +01:00
Vladimir Serbinenko
af435524cd grub_fshelp_read_file: Don't attempt to read past the end of file. 2015-01-21 17:38:04 +01:00
Peter Nelson
58f66137a3 * grub-core/fs/ext2.c (grub_ext2_read_block): Support large sparse chunks. 2014-12-07 17:57:49 +01:00
Andrei Borzenkov
03d79a878b grub-core/fs/zfs/zfsinfo.c: memory leak in print_vdev_info
CID: 73635
2014-12-01 20:54:12 +03:00
Andrey Borzenkov
954fe77163 cleanup: grub_cpu_to_XXX_compile_time for constants
This tries to catch all cases where grub_cpu_to_XXX was used for constant
expressions (including sizeof).
2014-09-22 20:47:10 +04:00
Michael Chang
54bd9a0610 Fix incorrect address reference in btrfs
We encountered a weird random kernel initrd unpacking error on btrfs
and finally found it was caused by incorrect address reference in range
check for type GRUB_BTRFS_EXTENT_REGULAR and the entire result is
unpredictable.

This is a quick fix to make the address reference to the
grub_btrfs_extent_data structure correctly, not the pointer variable
to it.

Any suggestions to this patch is welcome.
2014-09-08 11:33:40 +01:00
Vladimir Serbinenko
33f6ce671f * grub-core/fs/cbfs.c: Don't probe disks of unknow size.
Fixes hang on virtualbox.
2014-08-10 09:50:36 +02:00
Thomas Falcon
4afd0107ef btrfs: fix get_root key comparison failures due to endianness
* grub-core/fs/btrfs.c (get_root): Convert
GRUB_BTRFS_ROOT_VOL_OBJECTID to little-endian.
2014-03-31 15:32:30 +01:00
Vladimir Serbinenko
2e238b3708 Make grub_zlib_decompress handle incomplete chunks.
Fixes squash4.
2013-12-18 23:39:49 +01:00
Vladimir Serbinenko
b8765fa082 Implement better integration with Mac firmware. 2013-12-17 15:21:02 +01:00
Vladimir Serbinenko
cc6fb517de Remove practice of assigning random const pointers to device id.
This is not required as cache code already checks driver id as well.
2013-12-16 14:49:11 +01:00
Vladimir Serbinenko
7e47e27bd8 Add gcc_struct to all packed structures when compiling with mingw.
Just "packed" doesn't always pack the way we expect.
2013-12-15 14:14:30 +01:00
Vladimir Serbinenko
1a454efe89 Decrease stack usage in BtrFS.
We have only 92K of stack and using over 4K per frame is wasteful

	* grub-core/fs/btrfs.c (grub_btrfs_lzo_decompress): Allocate on heap
	rather than stack.
2013-11-16 16:15:26 +01:00
Vladimir Serbinenko
7b5d51d837 Decrease stack usage in JFS.
We have only 92K of stack and using over 4K per frame is wasteful

	* grub-core/fs/jfs.c (getblk): Allocate on heap rather than on
	stack. Note: this function is recursive.
	(grub_jfs_read_inode): Read only part we care about.
2013-11-16 16:00:42 +01:00
Colin Watson
5da5517288 * grub-core/fs/ext2.c (grub_ext2_read_block): Factor out common code for indirect block handling.
Saves 185 bytes on compressed image.
2013-11-14 08:13:06 +00:00
Vladimir Serbinenko
81023dbdbd * grub-core/fs/zfs/zfs.c (ZAP_LEAF_NUMCHUNKS): Use unsigned arithmetics. 2013-11-13 09:27:36 +01:00
Vladimir Serbinenko
3bbeade41d * grub-core/fs/proc.c: Allow \0 in proc files. 2013-11-12 15:57:09 +01:00
Vladimir Serbinenko
ac8cac1dac * grub-core/fs/ext2.c: Remove variable length arrays. 2013-11-12 03:04:19 +01:00
Vladimir Serbinenko
9612ebc00e Add new ports: i386-xen and x86_64-xen. This allows running GRUB in
XEN PV environment and load kernels.
2013-11-09 21:29:11 +01:00
Vladimir Serbinenko
8b66bb5d8d * grub-core/fs/zfs/zfscrypt.c (grub_ccm_decrypt): Return right error
type.
	(grub_gcm_decrypt): Likewise.
	(algo_decrypt): Likewise.
	(grub_zfs_decrypt_real): Transform error type.
2013-11-07 00:59:44 +01:00
Vladimir Serbinenko
70bb6c855e * grub-core/fs/reiserfs.c (grub_reiserfs_iterate_dir): Fix type of
entry_type.
2013-11-07 00:48:04 +01:00
Vladimir Serbinenko
bed78ef4e6 Revert "Attempts at ZFS options"
It was accidently committed to wrong branch

This reverts commit 0ee5cdfe9f.
2013-11-03 16:52:33 +01:00