diff options
author | Pádraig Brady <P@draigBrady.com> | 2014-08-23 01:18:58 +0100 |
---|---|---|
committer | Pádraig Brady <P@draigBrady.com> | 2014-08-23 01:23:20 +0100 |
commit | 8338c4dc4ac088025cf0403e46d311390aad042d (patch) | |
tree | 402425dba9720bdbff7fa949121769c9e323b090 | |
parent | 1505b379af16deab5b301b2f07f1d659ce2137cb (diff) | |
download | coreutils-8338c4dc4ac088025cf0403e46d311390aad042d.tar.xz |
maint: ensure fiemap extents flags are compared correctly
* src/extent-scan.c (extent_scan_read): Following on from the flags size
adjustment in commit v8.23-13-g1505b37, verify that the internal
representation of the flags is never truncated which could happen in the
unlikely case on 32 bit if the kernel flags ever expanded to 64 bits
which is theoretically possible given the reserved space.
-rw-r--r-- | src/extent-scan.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/extent-scan.c b/src/extent-scan.c index 805997a7b..3af8f991d 100644 --- a/src/extent-scan.c +++ b/src/extent-scan.c @@ -140,6 +140,8 @@ extent_scan_read (struct extent_scan *scan) assert (fm_extents[i].fe_logical <= OFF_T_MAX - fm_extents[i].fe_length); + verify (sizeof last_ei->ext_flags >= sizeof fm_extents->fe_flags); + if (si && last_ei->ext_flags == (fm_extents[i].fe_flags & ~FIEMAP_EXTENT_LAST) && (last_ei->ext_logical + last_ei->ext_length |