]> git.baikalelectronics.ru Git - kernel.git/commit
gfs2: Fix memory leak when gfs2meta's fs_context is freed
authorAndrew Price <anprice@redhat.com>
Fri, 4 Oct 2019 16:51:58 +0000 (11:51 -0500)
committerAndreas Gruenbacher <agruenba@redhat.com>
Thu, 24 Oct 2019 14:20:43 +0000 (16:20 +0200)
commita76f3c0268c1b52e2273ff2206cf9eff0b8996b7
tree9abde9d5faa01e4f667f60e01e1796c937f33404
parentd55ec79322ce9b92dd17cc61a7dbc4dc812814a3
gfs2: Fix memory leak when gfs2meta's fs_context is freed

gfs2 and gfs2meta share an ->init_fs_context function which allocates an
args structure stored in fc->fs_private. gfs2 registers a ->free
function to free this memory when the fs_context is cleaned up, but
there was not one registered for gfs2meta, causing a leak.

Register a ->free function for gfs2meta. The existing gfs2_fc_free
function does what we need.

Reported-by: syzbot+c2fdfd2b783754878fb6@syzkaller.appspotmail.com
Fixes: c15b787566a5 ("gfs2: Convert gfs2 to fs_context")
Signed-off-by: Andrew Price <anprice@redhat.com>
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
fs/gfs2/ops_fstype.c