Re: [PATCH v2] md/raid5-ppl: fix use-after-free in ppl_do_flush()
"yu kuai" <[email protected]> Thu, 30 Jul 2026 16:09:34 +0800
| Newsgroups | dev.linux.lists.linux-kernel-mentees,org.kernel.vger.linux-kernel,org.kernel.vger.linux-raid |
|---|---|
| Message-ID | <[email protected]> |
=E5=9C=A8 2026/6/22 22:06, Sajal Gupta =E5=86=99=E9=81=93:
> The loop in ppl_do_flush() continues iterating after calling
> ppl_io_unit_finished(), touching io->pending_flushes and leading to a
> use-after-free.
>
> Add a break statement to stop the loop once io is freed.
>
> Fixes: 1532d9e87e8b ("raid5-ppl: PPL support for disks with write-back ca=
che enabled")
> Reported-by: Dan Carpenter<[email protected]>
> Closes:https://lore.kernel.org/all/[email protected]/
> Signed-off-by: Sajal Gupta<[email protected]>
> ---
> Compile tested only.
>
> Changes in v2:
> - drop the refcount_t conversion
>
> v1:https://lore.kernel.org/all/20260622080656.22786-1-sajal2005gupta@gmai=
l.com/
>
> drivers/md/raid5-ppl.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
Applied to md-7.3
--=20
Thanks,
Kuai