]> git.baikalelectronics.ru Git - kernel.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)
committerAndreas Gruenbacher <agruenba@redhat.com>
Wed, 25 Nov 2020 17:10:55 +0000 (18:10 +0100)
commitae7831dfe7e7fcafff50aa9c8ff10850e45e2fdf
tree96707ce63859f1cd210625c8b9da7701190d907a
parentec03782929c9a7a149110ca678430f48511f854e
gfs2: check for empty rgrp tree in gfs2_ri_update

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>
fs/gfs2/rgrp.c