]> git.baikalelectronics.ru Git - kernel.git/commit
gfs2: Free rd_bits later in gfs2_clear_rgrpd to fix use-after-free
authorBob Peterson <rpeterso@redhat.com>
Tue, 27 Oct 2020 15:10:01 +0000 (10:10 -0500)
committerAndreas Gruenbacher <agruenba@redhat.com>
Thu, 29 Oct 2020 21:16:36 +0000 (22:16 +0100)
commit1d8a6d3f257be28f3ccce66a376b2f1293ac5093
tree97a986f49a518518cbf08e4e2907f743b088c727
parent2d339a2626e5cc4caeedaccd3059602f4608b212
gfs2: Free rd_bits later in gfs2_clear_rgrpd to fix use-after-free

Function gfs2_clear_rgrpd calls kfree(rgd->rd_bits) before calling
return_all_reservations, but return_all_reservations still dereferences
rgd->rd_bits in __rs_deltree.  Fix that by moving the call to kfree below the
call to return_all_reservations.

Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
fs/gfs2/rgrp.c