diff options
author | Mark Salyzyn <salyzyn@google.com> | 2015-04-06 12:16:42 -0700 |
---|---|---|
committer | Mark Salyzyn <salyzyn@google.com> | 2015-04-06 12:20:54 -0700 |
commit | 636d848860e5eac4225a830706fc34d48d8cc01e (patch) | |
tree | f2b9f713779565e627f1149894284ad68ceccb79 | |
parent | 01764adb2c182ef593fba3b9cdece112c26a4765 (diff) | |
download | extras-636d848860e5eac4225a830706fc34d48d8cc01e.tar.gz |
ext4_utils: xattr_assert_sane false positives
xattr_free_space() does not match kernel, it subtracts
sizeof(__u32) as a buffer zone to permit IS_LAST_ENTRY
to function. As documented in .../linux/fs/ext4/xattr.c:
+------------------+
| header |
| entry 1 | |
| entry 2 | | growing downwards
| entry 3 | v
| four null bytes | <<<< HERE is why sizeof(__u32)
| . . . |
| value 1 | ^
| value 3 | | growing upwards
| value 2 | |
+------------------+
Change-Id: Iee6e4e90664a3c2c5056006870b0f2f22b236bad
-rw-r--r-- | ext4_utils/contents.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ext4_utils/contents.c b/ext4_utils/contents.c index 3144de93..e4e38814 100644 --- a/ext4_utils/contents.c +++ b/ext4_utils/contents.c @@ -277,7 +277,7 @@ static size_t xattr_free_space(struct ext4_xattr_entry *entry, char *end) return 0; } - return end - ((char *) entry); + return (end - ((char *) entry)) - sizeof(uint32_t); } /* |