gfs2 filesystem and dlm development
 help / color / mirror / Atom feed
From: Andreas Gruenbacher <agruenba@redhat.com>
To: gfs2@lists.linux.dev
Cc: Andreas Gruenbacher <agruenba@redhat.com>
Subject: [PATCH] gf2: Do not dereference sdp->sd_jdesc in status_show
Date: Thu, 27 Aug 2026 21:06:32 +0200	[thread overview]
Message-ID: <20260827190632.686583-1-agruenba@redhat.com> (raw)

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 <agruenba@redhat.com>
---
 fs/gfs2/sys.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/gfs2/sys.c b/fs/gfs2/sys.c
index ea2c7b9e4a77..eecd4e7b12f4 100644
--- a/fs/gfs2/sys.c
+++ b/fs/gfs2/sys.c
@@ -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),
-- 
2.55.0


                 reply	other threads:[~2026-08-27 19:06 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260827190632.686583-1-agruenba@redhat.com \
    --to=agruenba@redhat.com \
    --cc=gfs2@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox