[PATCH] off-by-one in "Add checks to validate extent entries."

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Theodore Tso wrote:
> I haven't had time yet to check your other patches; could you also
> take a quick scan to make sure we have all of the byte-swapping calls
> needed for proper big-endian checking, that we're using the correct
> __le32 types and not doing any casts?

I had a look at all patches I have sent, but I didn't notice anything suspicious. While doing that, however I think I found an off-by-one in
56b19868aca856a7d7bf20c3a7a1030e4fd75b2b

Kind regards,

Thiemo

---
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index ac77d8b..6132353 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -342,7 +342,7 @@ static int ext4_valid_extent_idx(struct inode *inode,
        ext4_fsblk_t block = idx_pblock(ext_idx);
        struct ext4_super_block *es = EXT4_SB(inode->i_sb)->s_es;
        if (unlikely(block < le32_to_cpu(es->s_first_data_block) ||
-                       (block > ext4_blocks_count(es))))
+                       (block >= ext4_blocks_count(es))))
                return 0;
        else
                return 1;
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux