gf2: Do not dereference sdp->sd_jdesc in status_show
Andreas Gruenbacher
maintainerPATCH 1/1 gf2: Do not dereference sdp->sd_jdesc in status_show
Do not dereference sdp->sd_jdesc->jd_jid in status_show() to prevent a potential NULL pointer dereference during filesystem shutdown. Instead, get the journal ID from sdp->sd_lockstruct.ls_jid.
Signed-off-by Andreas Gruenbacher <[email protected]>
--- fs/gfs2/sys.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/gfs2/sys.c +1 -1
@@ -99,7 +99,7 @@ static ssize_t status_show(struct gfs2_sbd *sdp, char *buf)"sd_log_thresh2: %d\n" ,test_bit (SDF_JOURNAL_CHECKED , &f),test_bit (SDF_JOURNAL_LIVE , &f), - (sdp->sd_jdesc ? sdp->sd_jdesc->jd_jid :0 ), + sdp->sd_lockstruct.ls_jid, (sdp->sd_args.ar_spectator ?1 :0 ),test_bit (SDF_WITHDRAWN , &f), test_bit(SDF_NOBARRIERS, &f),
Signature · 1 line
2.55.0