]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commit
e2fsck: fix use after free in calculate_tree()
authorWang Shilong <wshilong@ddn.com>
Tue, 31 Dec 2019 00:52:39 +0000 (19:52 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 1 Jan 2020 18:41:34 +0000 (13:41 -0500)
commit101e73e99ccafa0403fcb27dd7413033b587ca01
tree52f224b139d1859a03aa2e977af7885d4dc08204
parent927ebc78a26cf7d7be09cd0b181c4a11a7a62590
e2fsck: fix use after free in calculate_tree()

The problem is alloc_blocks() will call get_next_block() which might
reallocate outdir->buf, and memory address could be changed after
this.  To fix this, pointers that point into outdir->buf, such as
int_limit and root need to be recaulated based on the new starting
address of outdir->buf.

[ Changed to correctly recalculate int_limit, and to optimize how we
  reallocate outdir->buf.  -TYT ]

Signed-off-by: Wang Shilong <wshilong@ddn.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
e2fsck/rehash.c