diff options
author | Josef Bacik <josef@redhat.com> | 2011-03-16 21:47:17 +0100 |
---|---|---|
committer | Josef Bacik <josef@redhat.com> | 2011-03-17 19:21:41 +0100 |
commit | 22a94d44bd6876a90630338229da6c0436d46593 (patch) | |
tree | 50e5c7dd52ccf9292240de995e5b42b1619bcd82 /fs/btrfs/xattr.c | |
parent | Btrfs: check return value of btrfs_search_slot properly (diff) | |
download | linux-22a94d44bd6876a90630338229da6c0436d46593.tar.xz linux-22a94d44bd6876a90630338229da6c0436d46593.zip |
Btrfs: add checks to verify dir items are correct
We need to make sure the dir items we get are valid dir items. So any time we
try and read one check it with verify_dir_item, which will do various sanity
checks to make sure it looks sane. Thanks,
Signed-off-by: Josef Bacik <josef@redhat.com>
Diffstat (limited to 'fs/btrfs/xattr.c')
-rw-r--r-- | fs/btrfs/xattr.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/btrfs/xattr.c b/fs/btrfs/xattr.c index a5776531dc2b..e5d22f280956 100644 --- a/fs/btrfs/xattr.c +++ b/fs/btrfs/xattr.c @@ -242,6 +242,8 @@ ssize_t btrfs_listxattr(struct dentry *dentry, char *buffer, size_t size) break; di = btrfs_item_ptr(leaf, slot, struct btrfs_dir_item); + if (verify_dir_item(root, leaf, di)) + continue; name_len = btrfs_dir_name_len(leaf, di); total_size += name_len + 1; |