Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
libext2fs: initialize i_extra_isize when writing EAs
If i_extra_isize is zero when we try to write extended attributes, we'll end up writing the EA magic into the i_extra_isize field, which causes a subsequent crash on big endian systems (when we try to write 0xEA02 bytes past the inode!). Therefore when the field is zero, set i_extra_isize to the desired extra_isize size, zero those bytes, and write the EAs after the end of the extended inode. v2: Don't bother if we have 128b inodes, and ensure that the value is 32b-aligned so that the EA magic starts on a 32b boundary. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
- Loading branch information
Showing
5 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Pass 1: Checking inodes, blocks, and sizes | ||
Pass 2: Checking directory structure | ||
Directory inode 12, block #0, offset 4: directory corrupted | ||
Salvage? yes | ||
|
||
Pass 3: Checking directory connectivity | ||
Pass 4: Checking reference counts | ||
Pass 5: Checking group summary information | ||
|
||
test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** | ||
test_filesys: 12/128 files (0.0% non-contiguous), 17/512 blocks | ||
Exit status is 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Pass 1: Checking inodes, blocks, and sizes | ||
Pass 2: Checking directory structure | ||
Pass 3: Checking directory connectivity | ||
Pass 4: Checking reference counts | ||
Pass 5: Checking group summary information | ||
test_filesys: 12/128 files (0.0% non-contiguous), 17/512 blocks | ||
Exit status is 0 |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
write EA when i_extra_size is zero |