[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <2purmecq5zso5dlheclxftxfalzazwgdunwvjap3ukhpp2bj57@7txx4wiaed2p>
Date: Fri, 15 Nov 2024 17:08:29 +0530
From: Abdul Rahim <abdul.rahim@...ahoo.com>
To: Christophe JAILLET <christophe.jaillet@...adoo.fr>
Cc: xiubli@...hat.com, idryomov@...il.com, ceph-devel@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] Use strscpy() instead of strcpy()
On Thu, Nov 14, 2024 at 09:53:46PM +0100, Christophe JAILLET wrote:
> Le 14/11/2024 à 10:14, Abdul Rahim a écrit :
> > On Wed, Nov 13, 2024 at 10:28:36PM +0100, Christophe JAILLET wrote:
>
> ...
>
> > diff --git a/fs/ceph/export.c b/fs/ceph/export.c
> > index 0e5b3c7b3756..48265c879fcf 100644
> > --- a/fs/ceph/export.c
> > +++ b/fs/ceph/export.c
> > @@ -452,7 +452,12 @@ static int __get_snap_name(struct dentry *parent, char *name,
> > goto out;
> > if (ceph_snap(inode) == CEPH_SNAPDIR) {
> > if (ceph_snap(dir) == CEPH_NOSNAP) {
> > - strcpy(name, fsc->mount_options->snapdir_name);
> > + /*
> > + * get_name assumes that name is pointing to a
> > + * NAME_MAX+1 sized buffer
> > + */
>
> It is a matter of taste, and I'm not the maintainer, but my personal feeling
> would go for something like:
>
> /* .get_name() from struct export_operations assumes that its 'name'
> parameter is pointing to a NAME_MAX+1 sized buffer */
>
> CJ
https://lore.kernel.org/lkml/20241115112419.11137-1-abdul.rahim@myyahoo.com/
Download attachment "signature.asc" of type "application/pgp-signature" (229 bytes)
Powered by blists - more mailing lists