Linux RAID subsystem development
 help / color / mirror / Atom feed
* [PATCH] md/raid5-ppl: check for NULL ppl_conf in ppl_write_stripe_run()
@ 2026-09-24 16:26 Svyatoslav Nikolenko
  2026-10-04  3:53 ` yu kuai
  0 siblings, 1 reply; 2+ messages in thread
From: Svyatoslav Nikolenko @ 2026-09-24 16:26 UTC (permalink / raw)
  To: song, yukuai
  Cc: magiclinan, xiao, linux-raid, linux-kernel, Svyatoslav Nikolenko,
	syzbot+75d7e96ad03ac2dbbd9f

Syzbot reported a general protection fault
due to a NULL pointer dereference in ppl_write_stripe_run().

When a RAID 5 array operates without Partial Parity Log (PPL) enabled or
before its initialization, conf->log_private remains NULL.
ppl_write_stripe_run() assigns ppl_conf = conf->log_private and
immediately attempts to access ppl_conf->count in the loop header.
This triggers a NULL pointer dereference.

Fix this by returning early
from ppl_write_stripe_run() if ppl_conf is NULL.

Tested-by: syzbot+75d7e96ad03ac2dbbd9f@syzkaller.appspotmail.com
Reported-by: syzbot+75d7e96ad03ac2dbbd9f@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=75d7e96ad03ac2dbbd9f
Fixes: 3418d036c81d ("raid5-ppl: Partial Parity Log write logging implementation")
Signed-off-by: Svyatoslav Nikolenko <nsvatoslav515@gmail.com>
---
 drivers/md/raid5-ppl.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/md/raid5-ppl.c b/drivers/md/raid5-ppl.c
index 7f8a9d3fd578..e54ed4e44b0f 100644
--- a/drivers/md/raid5-ppl.c
+++ b/drivers/md/raid5-ppl.c
@@ -535,6 +535,9 @@ void ppl_write_stripe_run(struct r5conf *conf)
 	struct ppl_log *log;
 	int i;
 
+	if (!ppl_conf)
+		return;
+
 	for (i = 0; i < ppl_conf->count; i++) {
 		log = &ppl_conf->child_logs[i];
 
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] md/raid5-ppl: check for NULL ppl_conf in ppl_write_stripe_run()
  2026-09-24 16:26 [PATCH] md/raid5-ppl: check for NULL ppl_conf in ppl_write_stripe_run() Svyatoslav Nikolenko
@ 2026-10-04  3:53 ` yu kuai
  0 siblings, 0 replies; 2+ messages in thread
From: yu kuai @ 2026-10-04  3:53 UTC (permalink / raw)
  To: Svyatoslav Nikolenko, song, yu kuai
  Cc: magiclinan, xiao, linux-raid, linux-kernel,
	syzbot+75d7e96ad03ac2dbbd9f

Hi,

在 2026/9/25 0:26, Svyatoslav Nikolenko 写道:
> Syzbot reported a general protection fault
> due to a NULL pointer dereference in ppl_write_stripe_run().
>
> When a RAID 5 array operates without Partial Parity Log (PPL) enabled or
> before its initialization, conf->log_private remains NULL.
> ppl_write_stripe_run() assigns ppl_conf = conf->log_private and
> immediately attempts to access ppl_conf->count in the loop header.
> This triggers a NULL pointer dereference.
>
> Fix this by returning early
> from ppl_write_stripe_run() if ppl_conf is NULL.
>
> Tested-by: syzbot+75d7e96ad03ac2dbbd9f@syzkaller.appspotmail.com
> Reported-by: syzbot+75d7e96ad03ac2dbbd9f@syzkaller.appspotmail.com
> Closes: https://syzkaller.appspot.com/bug?extid=75d7e96ad03ac2dbbd9f
> Fixes: 3418d036c81d ("raid5-ppl: Partial Parity Log write logging implementation")
> Signed-off-by: Svyatoslav Nikolenko <nsvatoslav515@gmail.com>
> ---
>   drivers/md/raid5-ppl.c | 3 +++
>   1 file changed, 3 insertions(+)

Another patch is applied for this problem, you can check the notes:

[PATCH] md: take reconfig_mutex when enabling PPL on an inactive array - 
Nguyen Ngoc Thang <https://lore.kernel.org/linux-raid/20260924171345.75894-1-ngocthang2710.1999@gmail.com/>

>
> diff --git a/drivers/md/raid5-ppl.c b/drivers/md/raid5-ppl.c
> index 7f8a9d3fd578..e54ed4e44b0f 100644
> --- a/drivers/md/raid5-ppl.c
> +++ b/drivers/md/raid5-ppl.c
> @@ -535,6 +535,9 @@ void ppl_write_stripe_run(struct r5conf *conf)
>   	struct ppl_log *log;
>   	int i;
>   
> +	if (!ppl_conf)
> +		return;
> +
>   	for (i = 0; i < ppl_conf->count; i++) {
>   		log = &ppl_conf->child_logs[i];
>   

-- 
Thanks,
Kuai

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-10-04  3:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-24 16:26 [PATCH] md/raid5-ppl: check for NULL ppl_conf in ppl_write_stripe_run() Svyatoslav Nikolenko
2026-10-04  3:53 ` yu kuai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox