From: Paul Walmsley <pjw@kernel.org>
To: shao.mingyin@zte.com.cn, gao.rui@zte.com.cn
Cc: pjw@kernel.org, mikey@neuling.org, jiangfeng@kylinos.cn,
palmer@dabbelt.com, aou@eecs.berkeley.edu, alex@ghiti.fr,
linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org,
zhang.yue5@zte.com.cn, david.laight.linux@gmail.com,
qingfang.deng@linux.dev, aurelien@aurel32.net,
troy.mitchell@linux.dev
Subject: Re: [PATCH v4] riscv: lib: Fix ZBB strnlen wrap-around regression on huge counts
Date: Mon, 5 Oct 2026 11:13:16 -0600 (MDT) [thread overview]
Message-ID: <970c63ed-9fa8-9d1f-4521-0a7119b9d6e5@kernel.org> (raw)
In-Reply-To: <20260928113518331HR61sfVYm8Lrb44vgAEuk@zte.com.cn>
Hi Shao Mingyin,
On Mon, 28 Sep 2026, shao.mingyin@zte.com.cn wrote:
> Hi Paul,
>
> Gentle ping on this one - it has picked up more tags since posting, and
> should be ready to be picked up:
>
> Acked-by: Michael Neuling <mikey@neuling.org>
> Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
> Tested-by: Troy Mitchell <troy.mitchell@linux.dev>
> Suggested-by: David Laight <david.laight.linux@gmail.com>
> Suggested-by: Qingfang Deng <qingfang.deng@linux.dev>
>
> It stays a minimal fix: only the two boundary-computation instructions
> in the ZBB path are replaced (18 insertions, 2 deletions, no new
> registers), so the scanning loop itself is unchanged.
>
> This one matters for stable - the regression is in v7.1.10+ and v7.2:
> strnlen(s, SIZE_MAX) returns 8 for any 8+-byte aligned string and
> truncates names built through FORTIFY strcat/strlcat (device-mapper's
> sysfs name "live-base" becomes "live-bas"), which broke blivet/anaconda
> installs and LVM on RISC-V systems. It has since been reproduced
> independently on a Fedora 45 riscv64 image with ZBB enabled, where the
> fix restores correct behaviour.
>
> Cc: stable is set, and the minimal form should backport cleanly to
> 7.1.y. Happy to rebase onto riscv/fixes or adjust anything if needed.
Thanks, queued for v7.3-rc. Rather than posting a new patch, it would
have been better for you to comment on Gao Rui's patch:
https://lore.kernel.org/linux-riscv/20260819161821053fNUWuvdGIo4HUBmxlcNfG@zte.com.cn/
However, since time is short to get something into v7.3-rc fixes, and the
approach you took in your patch seems better, I've queued yours instead.
- Paul
next prev parent reply other threads:[~2026-10-05 17:13 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-15 7:26 shao.mingyin
2026-09-22 3:48 ` Troy Mitchell
2026-09-25 20:54 ` Aurelien Jarno
2026-09-28 3:27 ` shao.mingyin
2026-09-28 3:35 ` shao.mingyin
2026-10-05 17:13 ` Paul Walmsley [this message]
2026-10-05 17:00 ` patchwork-bot+linux-riscv
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=970c63ed-9fa8-9d1f-4521-0a7119b9d6e5@kernel.org \
--to=pjw@kernel.org \
--cc=alex@ghiti.fr \
--cc=aou@eecs.berkeley.edu \
--cc=aurelien@aurel32.net \
--cc=david.laight.linux@gmail.com \
--cc=gao.rui@zte.com.cn \
--cc=jiangfeng@kylinos.cn \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=mikey@neuling.org \
--cc=palmer@dabbelt.com \
--cc=qingfang.deng@linux.dev \
--cc=shao.mingyin@zte.com.cn \
--cc=troy.mitchell@linux.dev \
--cc=zhang.yue5@zte.com.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®