]> git.proxmox.com Git - grub2.git/commit
io/gzio: Add init_dynamic_block() clean up if unpacking codes fails
authorDaniel Axtens <dja@axtens.net>
Wed, 20 Jan 2021 13:05:58 +0000 (00:05 +1100)
committerColin Watson <cjwatson@debian.org>
Sun, 13 Jun 2021 23:40:46 +0000 (00:40 +0100)
commit5d3a0f0c42ef45717526a4a6ac31c220b0b77d58
treeeb47c9fec9865780a85f374cd65f954a91e96f2d
parent7ad63f14e62e04675ae6fc4ee8eac39cb49f08e2
io/gzio: Add init_dynamic_block() clean up if unpacking codes fails

init_dynamic_block() didn't clean up gzio->tl and td in some error
paths. This left td pointing to part of tl. Then in grub_gzio_close(),
when tl was freed the storage for td would also be freed. The code then
attempts to free td explicitly, performing a UAF and then a double free.

Explicitly clean up tl and td in the error paths.

Signed-off-by: Daniel Axtens <dja@axtens.net>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Patch-Name: 2021-02-security/081-io-gzio-Add-init_dynamic_block-clean-up-if-unpacking-codes-fails.patch
grub-core/io/gzio.c