mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paul Walmsley <pjw@kernel.org>
To: Zongmin Zhou <min_halo@163.com>
Cc: oleg@redhat.com, pjw@kernel.org, palmer@dabbelt.com,
	aou@eecs.berkeley.edu,  alex@ghiti.fr, andybnac@gmail.com,
	debug@rivosinc.com,  linux-riscv@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	 Zongmin Zhou <zhouzongmin@kylinos.cn>
Subject: Re: [PATCH] riscv: ptrace: Zero-initialize regset buffers before copyin
Date: Wed, 7 Oct 2026 10:46:38 -0600 (MDT)	[thread overview]
Message-ID: <9daae172-b921-2422-b089-df9255e5f218@kernel.org> (raw)
In-Reply-To: <20260826115711.86861-1-min_halo@163.com>

On Wed, 26 Aug 2026, Zongmin Zhou wrote:

> From: Zongmin Zhou <zhouzongmin@kylinos.cn>
> 
> user_regset_copyin() only copies `count` bytes, so a PTRACE_SETREGSET
> request with a short iov_len leaves the rest of the stack buffer
> uninitialized. In riscv_vr_set() that garbage is validated and copied
> into the target's vstate, and in riscv_cfi_set() it can be stored as
> the target's shadow stack pointer. Zero both buffers, as the get path
> already does.
> 
> Fixes: 9300f0043974 ("RISC-V: Add ptrace support for vectors")
> Fixes: 2af7c9cf021c ("riscv/ptrace: expose riscv CFI status and state via ptrace and in core files")
> Signed-off-by: Zongmin Zhou <zhouzongmin@kylinos.cn>

Thanks, queued for v7.3-rc.


- Paul


      reply	other threads:[~2026-10-07 16:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-26 11:57 Zongmin Zhou
2026-10-07 16:46 ` 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=9daae172-b921-2422-b089-df9255e5f218@kernel.org \
    --to=pjw@kernel.org \
    --cc=alex@ghiti.fr \
    --cc=andybnac@gmail.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=debug@rivosinc.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=min_halo@163.com \
    --cc=oleg@redhat.com \
    --cc=palmer@dabbelt.com \
    --cc=zhouzongmin@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

all inboxes | Powered by JetHome®