From: Paul Walmsley <pjw@kernel.org>
To: Wang Yan <wangyan01@kylinos.cn>
Cc: shuah@kernel.org, pjw@kernel.org, palmer@dabbelt.com,
aou@eecs.berkeley.edu, alex@ghiti.fr, geomatsi@gmail.com,
andybnac@gmail.com, andrew.jones@oss.qualcomm.com,
thecharlesjenkins@gmail.com, linux-kselftest@vger.kernel.org,
linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] selftests/riscv: ptrace: Fix memory leak of regset_data in vector tests
Date: Fri, 10 Jul 2026 09:38:25 -0600 (MDT) [thread overview]
Message-ID: <5ad27d5d-a396-341b-324d-ff2ca7bae26f@kernel.org> (raw)
In-Reply-To: <20260710083437.489648-1-wangyan01@kylinos.cn>
On Fri, 10 Jul 2026, Wang Yan wrote:
> The regset_data buffer allocated with calloc() in the parent process
> of several vector ptrace tests is never freed before returning,
> causing memory leaks in:
>
> - ptrace_v_not_enabled
> - ptrace_v_early_debug
> - ptrace_v_syscall_clobbering
> - v_csr_invalid/ptrace_v_invalid_values
> - v_csr_valid/ptrace_v_valid_values
>
> Add free(regset_data) before kill(pid, SIGKILL) to release the
> allocated buffer.
>
> Signed-off-by: Wang Yan <wangyan01@kylinos.cn>
Thanks, queued for v7.2-rc.
- Paul
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
prev parent reply other threads:[~2026-07-10 15:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-10 8:34 [PATCH] selftests/riscv: ptrace: Fix memory leak of regset_data in vector tests Wang Yan
2026-07-10 10:16 ` Sergey Matyukevich
2026-07-10 15:38 ` Paul Walmsley [this message]
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=5ad27d5d-a396-341b-324d-ff2ca7bae26f@kernel.org \
--to=pjw@kernel.org \
--cc=alex@ghiti.fr \
--cc=andrew.jones@oss.qualcomm.com \
--cc=andybnac@gmail.com \
--cc=aou@eecs.berkeley.edu \
--cc=geomatsi@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@dabbelt.com \
--cc=shuah@kernel.org \
--cc=thecharlesjenkins@gmail.com \
--cc=wangyan01@kylinos.cn \
/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