From: Svyatoslav Nikolenko <nsvatoslav515@gmail.com>
To: song@kernel.org, yukuai@fygo.io
Cc: magiclinan@didiglobal.com, xiao@kernel.org,
linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org,
Svyatoslav Nikolenko <nsvatoslav515@gmail.com>,
syzbot+270624bb31d478afe62e@syzkaller.appspotmail.com
Subject: [PATCH] md/raid5: fix NULL pointer dereference in raid5_has_ppl
Date: Tue, 22 Sep 2026 15:54:17 +0300 [thread overview]
Message-ID: <20260922125418.2715-1-nsvatoslav515@gmail.com> (raw)
Check if conf->mddev is non-NULL in raid5_has_ppl() before testing flags to
prevent a KASAN null-ptr-deref during free_conf() cleanup paths.
Reported-by: syzbot+270624bb31d478afe62e@syzkaller.appspotmail.com
Tested-by: syzbot+270624bb31d478afe62e@syzkaller.appspotmail.com
Signed-off-by: Svyatoslav Nikolenko <nsvatoslav515@gmail.com>
---
drivers/md/raid5-log.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/md/raid5-log.h b/drivers/md/raid5-log.h
index c8332502669e..5a144051b142 100644
--- a/drivers/md/raid5-log.h
+++ b/drivers/md/raid5-log.h
@@ -51,7 +51,7 @@ static inline bool raid5_has_log(struct r5conf *conf)
static inline bool raid5_has_ppl(struct r5conf *conf)
{
- return test_bit(MD_HAS_PPL, &conf->mddev->flags);
+ return conf->mddev && test_bit(MD_HAS_PPL, &conf->mddev->flags);
}
static inline int log_stripe(struct stripe_head *sh, struct stripe_head_state *s)
--
2.47.3
next reply other threads:[~2026-09-22 12:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-22 12:54 Svyatoslav Nikolenko [this message]
2026-09-23 11:23 ` yu kuai
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=20260922125418.2715-1-nsvatoslav515@gmail.com \
--to=nsvatoslav515@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-raid@vger.kernel.org \
--cc=magiclinan@didiglobal.com \
--cc=song@kernel.org \
--cc=syzbot+270624bb31d478afe62e@syzkaller.appspotmail.com \
--cc=xiao@kernel.org \
--cc=yukuai@fygo.io \
/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
all inboxes | Powered by JetHome®