OrangePi_CM5/fs/gfs2
Bob Peterson 04dd45d977 gfs2: assign rgrp glock before compute_bitstructs
commit 428f651cb80b227af47fc302e4931791f2fb4741 upstream.

Before this patch, function read_rindex_entry called compute_bitstructs
before it allocated a glock for the rgrp. But if compute_bitstructs found
a problem with the rgrp, it called gfs2_consist_rgrpd, and that called
gfs2_dump_glock for rgd->rd_gl which had not yet been assigned.

read_rindex_entry
   compute_bitstructs
      gfs2_consist_rgrpd
         gfs2_dump_glock <---------rgd->rd_gl was not set.

This patch changes read_rindex_entry so it assigns an rgrp glock before
calling compute_bitstructs so gfs2_dump_glock does not reference an
unassigned pointer. If an error is discovered, the glock must also be
put, so a new goto and label were added.

Reported-by: syzbot+c6fd14145e2f62ca0784@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>
2022-04-27 13:53:46 +02:00
..
Kconfig
…
Makefile
…
acl.c
…
acl.h
…
aops.c
…
aops.h
…
bmap.c gfs2: gfs2_setattr_size error path fix 2022-04-13 21:00:54 +02:00
bmap.h
…
dentry.c
…
dir.c
…
dir.h
…
export.c
…
file.c gfs2: gfs2_setattr_size error path fix 2022-04-13 21:00:54 +02:00
gfs2.h
…
glock.c gfs2: Fix glock_hash_walk bugs 2021-11-18 14:04:00 +01:00
glock.h
…
glops.c gfs2: Fix glock recursion in freeze_go_xmote_bh 2021-09-18 13:40:25 +02:00
glops.h
…
incore.h
…
inode.c gfs2: gfs2_setattr_size error path fix 2022-04-13 21:00:54 +02:00
inode.h
…
lock_dlm.c gfs2: Don't call dlm after protocol is unmounted 2021-09-18 13:40:30 +02:00
log.c treewide: Change list_sort to use const pointers 2021-09-30 10:11:04 +02:00
log.h
…
lops.c treewide: Change list_sort to use const pointers 2021-09-30 10:11:04 +02:00
lops.h
…
main.c
…
meta_io.c
…
meta_io.h
…
ops_fstype.c
…
quota.c
…
quota.h
…
recovery.c
…
recovery.h
…
rgrp.c gfs2: assign rgrp glock before compute_bitstructs 2022-04-27 13:53:46 +02:00
rgrp.h gfs2: gfs2_setattr_size error path fix 2022-04-13 21:00:54 +02:00
super.c gfs2: gfs2_setattr_size error path fix 2022-04-13 21:00:54 +02:00
super.h
…
sys.c
…
sys.h
…
trace_gfs2.h
…
trans.c
…
trans.h
…
util.c
…
util.h
…
xattr.c
…
xattr.h
…