Re: [PATCH] ext34: ensure do_split leaves enough free space in both blocks

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

 



Eric Sandeen wrote:
> The do_split() function for htree dir blocks is intended to split a
> leaf block to make room for a new entry.  It sorts the entries in the
> original block by hash value, then moves the last half of the entries to 
> the new block - without accounting for how much space this actually moves.  
> (IOW, it moves half of the entry *count* not half of the entry *space*).
> If by chance we have both large & small entries, and we move only the 
> smallest entries, and we have a large new entry to insert, we may not have 
> created enough space for it.

(btw, the upshot of this is that in add_dirent_to_buf(),
memcpy(de->name, name, namelen) will overshoot the buffer and actually
corrupt memory.)

:(

-Eric
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux