Re: [PATCH 21/28] NFS: nfsroot: Refactor root_nfs_cat() to use snprintf()

From: Kees Cook

Date: Tue Sep 15 2026 - 15:33:49 EST


On Tue, Sep 15, 2026 at 08:18:38AM +0000, Bill Wendling wrote:
> fs/nfs/nfsroot.c | 11 +++++++----
> 1 file changed, 7 insertions(+), 4 deletions(-)

This collides with:
https://lore.kernel.org/all/27956255dde39f58d73a7b51cb53cbe3d7804f54.1786411026.git.mariianikitash@xxxxxxxxxx/

> + ret = snprintf(dest + len, destlen - len, "%s%s",
> + (len && dest[len - 1] != ',') ? "," : "", src);

I prefer Mariia's version because this inline ternary is difficult
to read.

I was expecting to land hers soon if the NFS folks don't pipe up. It is
one of the rare cases of still being open-coded, but the strlen() usage
was pre-existing to check for the trailing comma, so it's not a clean
seq_buf() conversion candidate...

--
Kees Cook