mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Trond Myklebust <trondmy@kernel.org>
To: Lalit Shankar Chowdhury <lalitshankarch@gmail.com>,
	Anna Schumaker <anna@kernel.org>,
	"open list:NFS, SUNRPC,
	AND LOCKD CLIENTS" <linux-nfs@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] NFS: replace sprintf() with snprintf() in nfs_root_setup
Date: Wed, 09 Sep 2026 10:04:32 -0400	[thread overview]
Message-ID: <af38d347c93f00a5524de00dddef5ba54f692b87.camel@kernel.org> (raw)
In-Reply-To: <20260908183444.183687-1-lalitshankarch@gmail.com>

On Tue, 2026-09-08 at 18:34 +0000, Lalit Shankar Chowdhury wrote:
> Replace sprintf() with snprintf() to perform bounds checking when
> formatting.
> 
> Signed-off-by: Lalit Shankar Chowdhury <lalitshankarch@gmail.com>
> ---
>  fs/nfs/nfsroot.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/nfs/nfsroot.c b/fs/nfs/nfsroot.c
> index 432612d22437..d2c26d5378a6 100644
> --- a/fs/nfs/nfsroot.c
> +++ b/fs/nfs/nfsroot.c
> @@ -144,7 +144,7 @@ static int __init nfs_root_setup(char *line)
>  		size_t n = strlen(line) + sizeof(NFS_ROOT) - 1;
>  		if (n >= sizeof(nfs_root_parms))
>  			line[sizeof(nfs_root_parms) -
> sizeof(NFS_ROOT) - 2] = '\0';
> -		sprintf(nfs_root_parms, NFS_ROOT, line);
> +		snprintf(nfs_root_parms, sizeof(nfs_root_parms),
> NFS_ROOT, line);
>  	}
>  
>  	/*

Please see the two lines immediately above the one you're replacing.
-- 
Trond Myklebust
Linux NFS client maintainer, Hammerspace
trondmy@kernel.org, trond.myklebust@hammerspace.com

      reply	other threads:[~2026-09-09 14:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-08 18:34 Lalit Shankar Chowdhury
2026-09-09 14:04 ` Trond Myklebust [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=af38d347c93f00a5524de00dddef5ba54f692b87.camel@kernel.org \
    --to=trondmy@kernel.org \
    --cc=anna@kernel.org \
    --cc=lalitshankarch@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    /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®