]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
gfs2: check for empty rgrp tree in gfs2_ri_update
authorBob Peterson <rpeterso@redhat.com>
Tue, 24 Nov 2020 15:44:36 +0000 (10:44 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 11 Dec 2020 12:22:11 +0000 (13:22 +0100)
commitcecb2b21c1de948505ef1119499d37e20cb990df
tree5f4f37f82a0bc02a47e7b9adaa6a7a5f61a2f23a
parent1b1e68927e09bad4a29624e494fd7a73c1b7719b
gfs2: check for empty rgrp tree in gfs2_ri_update

commit 778721510e84209f78e31e2ccb296ae36d623f5e upstream.

If gfs2 tries to mount a (corrupt) file system that has no resource
groups it still tries to set preferences on the first one, which causes
a kernel null pointer dereference. This patch adds a check to function
gfs2_ri_update so this condition is detected and reported back as an
error.

Reported-by: syzbot+e3f23ce40269a4c9053a@syzkaller.appspotmail.com
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/gfs2/rgrp.c