Commit Graph

597 Commits

Author SHA1 Message Date
Andrei Borzenkov 6cef7f6079 btrfs: avoid "used uninitialized" error with GCC7
sblock was local and so considered new variable on every loop
iteration.

Closes: 50597
2017-04-04 19:22:32 +03:00
Andrei Borzenkov 951306c509 squash4: fix handling of fragments and sparse files
1. Do not assume block list and fragment are mutually exclusive. Squash
can pack file tail as fragment (unless -no-fragments is specified); so
check read offset and read either from block list or from fragments as
appropriate.

2. Support sparse files with zero blocks.

3. Fix fragment read - frag.offset is absolute fragment position,
not offset relative to ino.chunk.

Reported and tested by Carlo Caione <carlo@endlessm.com>
2017-02-24 19:10:43 +03:00
Carlo Caione a0413e2677 exfat: Support files over 4GiB
file size in grub_fat_data was 32-bit on exfat.
2017-01-27 22:10:21 +00:00
Andrei Borzenkov 58590cb2ef xfs: accept filesystem with meta_uuid
XFS V5 stores UUID in metadata and compares them with superblock UUID.
To allow changing of user-visible UUID it stores original value in new
superblock field (meta_uuid) and sets incompatible flag to indicate that
new field must be used to verify metadata. Our driver currently does not
check metadata UUID so simply accept such filesystem.

Reported-By: Marcos Mello <marcosfrm@outlook.com>
Reviewd by Jan Kara <jack@suse.cz>
2016-07-26 20:29:26 +03:00
Aaron Luft 76eac44af3 Remove the variable oldname which is attempting to free stack space.
Historically this variable hold previous value of filename that
had to be freed if allocated previously. Currently this branch
is entered only if filename was not allocated previously so it
became redundant. It did not cause real problems because grub_free
was not called, but code is confusing and causes compilation error
in some cases.
2016-03-15 22:04:38 +03:00
Vladimir Serbinenko 5cae910665 Fix warnings when compiling with -O3 2016-02-17 17:56:41 +01:00
Toomas Soome ce01054ec3 lz4: Fix pointer overflow 2016-02-12 17:26:32 +01:00
Andrei Borzenkov aafd205c92 xfs: fix possible inode corruption in directory scan
grub_xfs_iterate_dir did not restore first character after inline
name when match was found. Dependning on XFS format this character
could be inode number and we could return to the same node later in
find_file if processing cycled symlinks.

CID: 86724
2016-01-09 18:55:55 +03:00
Andrei Borzenkov 8ab2675ede hfs: fix memory leak
Found by: Coverity scan.
CID: 156531
2016-01-09 11:36:42 +03:00
Vladimir Serbinenko ca7bb46d5c exfat: Fix stream extension flag parsing. 2015-12-29 17:42:25 +01:00
Vladimir Serbinenko cb28250cfc cbfs: Fix corner case and compilation with recdent gcc
Accept the header to touch the jump address at 0xfffffff0.

Fix compilation for 64-bit EFI with recent GCC.
2015-11-09 03:24:04 +01:00
Vladimir Serbinenko 855fe6869c cbfs: Check for ptr range sanity.
Triaged by Andrei and enhanced with suggestions by Aaron Durbin
Also-By: Andrei Borzenkov <arvidjaar@gmail.com>
2015-11-08 20:34:30 +01:00
Alexander Bluhm f188a86064 ufs: Fix parameters to grub_memset.
len = 0 made simply no sense. Fix parameters to be in line with read.
2015-10-09 13:35:40 +02:00
Vladimir Serbinenko d3b464a7c0 archelp: Never pass NULL as mtime.
Moves complexity from fs code (NULL check) to common code (passing non-NULL).
2015-07-27 13:19:02 +02:00
Vladimir Serbinenko 5fb1e859f7 HFS: Convert to fshelp.
HFS doesn't handle "." and ".." properly. Convert it to fshelp to reuse the
logic.
2015-07-27 12:50:22 +02:00
Vladimir Serbinenko bfb5b33e96 FAT: Convert to fshelp.
exFAT doesn't handle "." and ".." correctly, convert it to fshelp to
reuse the same logic.
2015-07-27 12:49:26 +02:00
Vladimir Serbinenko d1d3a60b71 BFS: Convert to fshelp.
BFS doesn't handle ".." correctly, so convert it to fshelp to reuse the logic.
2015-07-27 12:48:38 +02:00
Vladimir Serbinenko fa93b0e4f5 fshelp: Add handling of "." and ".." and grub_fshelp_find_file_lookup.
Recent tests have discovered that many of our filesystems have flawed
handling of "." and "..". Rather than attempting to fix it in filesystems
themselves, make the common code fshelp aware of "." and ".." and handle
them in this layer. Add grub_fshelp_find_file_lookup for easy conversion
of BFS, HFS and exFAT which have the same problem and don't use fshelp.
2015-07-27 12:45:35 +02:00
Vladimir Serbinenko 4622f4e1ee Switch procfs to use archelp.
This fixes handling of "." and "..".
2015-07-27 12:44:19 +02:00
Vladimir Serbinenko 049dcfa03c xfs: Fix handling of symlink with crc-enabled filesystem. 2015-07-24 01:23:45 +02:00
Vladimir Serbinenko 02a249005f reiserfs: Fix handling of first entry in the directory.
Fixes garbage being added to "." filename.
2015-07-24 01:23:45 +02:00
Vladimir Serbinenko f34a422081 archelp: Fix handling of dot and dotdot at the end of the name.
Fixes cpio_test and tar_test.
2015-07-23 19:01:00 +02:00
Vladimir Serbinenko ff3c2007ef XFS: Fix wrong alignment treatment. 2015-07-16 12:46:02 +02:00
Vladimir Serbinenko 54e7dbbcb9 grub_ext2_read_block: Fix return type on error. 2015-07-16 10:59:33 +02:00
Andrei Borzenkov fbdd37e7f9 zfs: fix memory leak
Found by: Coverity scan.
CID: 73647
2015-06-19 20:47:43 +03:00
Andrei Borzenkov 4db569ca6a xfs: silence Coverity overflow warning
inode size cannot really overflow integer, but Coverity does not know it.
CID: 96602
2015-06-19 18:38:25 +03:00
Andrei Borzenkov 15ba6a40be zfs: memory leak
Found by Coverity scan.
CID: 96603
2015-06-19 18:38:25 +03:00
Andrei Borzenkov 7bb7140df2 fat: fix handling of "." and ".." directory entries
Emulate dot and dotdot in root directory. For other directories do not
add separator between name and extension for these two special entries.

Closes: 45335
2015-06-18 20:09:47 +03:00
Jan Kara b6e80c7778 xfs: V5 filesystem format support
Add support for new XFS on disk format. We have to handle optional
filetype fields in directory entries, additional CRC, LSN, UUID entries
in some structures, etc.

Signed-off-by: Jan Kara <jack@suse.cz>
2015-06-12 09:30:02 +03:00
Jan Kara d3ffeb9a9a xfs: Add helpers for inode size
Add helpers to return size of XFS inode on disk and when loaded in
memory.

Signed-off-by: Jan Kara <jack@suse.cz>
2015-06-12 09:27:09 +03:00
Toomas Soome cad5cc0f5d zfs extensible_dataset and large_blocks feature support
large blocks basically use extensible dataset feature, or to be exact,
setting recordsize above 128k will trigger large_block feature to be
enabled and storing such blocks is using feature extensible dataset. so
the extensible dataset is prerequisite.

Changes implement read support extensible dataset… instead of fixed DMU
types they dont specify type, making it possible to use fat zap objects
from bonus area.
2015-05-30 08:50:53 +03:00
Andrei Borzenkov 5370dcfdae zfs: fix integer truncation in zap_lookup
Size after shift could exceed 16 bits; use grub_unit32_t for result.

Reported and tested by: Kostya Berger <bergerkos@yahoo.co.uk>
Closes: 44448
2015-05-14 07:50:33 +03:00
Jan Kara a139188eb5 xfs: Convert inode numbers to cpu endianity immediately after reading
Currently XFS driver converted inode numbers to native endianity only
when using them to compute inode position. Although this works, it is
somewhat confusing. So convert inode numbers when reading them from disk
structures as every other field.

Signed-off-by: Jan Kara <jack@suse.cz>
2015-05-12 08:21:10 +03:00
Jan Kara 1570140f03 xfs: Fix termination loop for directory iteration
Directory iteration used wrong position (sizeof wrong structure) for
termination of iteration inside a directory block. Luckily the position
ended up being wrong by just 1 byte and directory entries are larger so
things worked out fine in practice. But fix the problem anyway.

Signed-off-by: Jan Kara <jack@suse.cz>
2015-05-11 14:48:14 +03:00
Andrei Borzenkov 6210b8e8f7 zfs: add missing NULL check and fix incorrect buffer overwrite
grub_memset should zero out padding after data end. It is not clear
why it is needed at all - ZFS block is at least 512 bytes and power
of two, so it is always multiple of 16 bytes. This grub_memset
apparently never did anything.
2015-05-03 18:57:32 +03:00
Toomas Soome 4a7ea4003b zfs: com.delphix:embedded_data feature support 2015-05-03 18:45:40 +03:00
Toomas Soome a1007c6af2 zfs: com.delphix:hole_birth feature support
In the past birth was always zero for holes. This feature started
to make use of birth for holes as well, so change code to test for
valid DVA address instead.
2015-05-03 18:11:29 +03:00
Michael Zimmermann ed07b7e128 Add missing initializers to silence suprious warnings. 2015-03-27 14:44:41 +01:00
Vladimir Serbinenko 5fe21c9968 hfsplus: Fix potential access to uninited memory on invalid FS 2015-03-06 22:33:20 +01:00
Vladimir Serbinenko 87a04adb65 zfs/mzap_lookup: Fix argument types 2015-02-21 16:22:01 +01:00
Vladimir Serbinenko 5537a586e0 ext2: Ignore INCOMPAT_MMP.
It's not really incompatible as long as driver never writes to FS.
2015-02-16 21:08:37 +01:00
Vladimir Serbinenko e20aa39ea4 ext2: Support META_BG.
This fixes bug that system would become unbootable after ext*
online resize if no resize_inode was created at ext* format time.
2015-02-16 20:53:26 +01:00
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