* [PATCH] fs/nfs: Fix nfs_parse_devname to not modify it's argument
@ 2019-01-30 13:58 Eric W. Biederman
2019-02-21 22:41 ` Trond Myklebust
0 siblings, 1 reply; 2+ messages in thread
From: Eric W. Biederman @ 2019-01-30 13:58 UTC (permalink / raw)
To: Trond Myklebust, Anna Schumaker; +Cc: linux-nfs, linux-fsdevel
In the rare and unsupported case of a hostname list nfs_parse_devname
will modify dev_name. There is no need to modify dev_name as the all
that is being computed is the length of the hostname, so the computed
length can just be shorted.
Fixes: dc04589827f7 ("NFS: Use common device name parsing logic for NFSv4 and NFSv2/v3")
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
---
fs/nfs/super.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index 22ce3c8a2f46..35af005af748 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -1914,7 +1914,7 @@ static int nfs_parse_devname(const char *dev_name,
/* kill possible hostname list: not supported */
comma = strchr(dev_name, ',');
if (comma != NULL && comma < end)
- *comma = 0;
+ len = comma - dev_name;
}
if (len > maxnamlen)
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] fs/nfs: Fix nfs_parse_devname to not modify it's argument
2019-01-30 13:58 [PATCH] fs/nfs: Fix nfs_parse_devname to not modify it's argument Eric W. Biederman
@ 2019-02-21 22:41 ` Trond Myklebust
0 siblings, 0 replies; 2+ messages in thread
From: Trond Myklebust @ 2019-02-21 22:41 UTC (permalink / raw)
To: anna.schumaker, ebiederm; +Cc: linux-nfs, linux-fsdevel
On Wed, 2019-01-30 at 07:58 -0600, Eric W. Biederman wrote:
> In the rare and unsupported case of a hostname list nfs_parse_devname
> will modify dev_name. There is no need to modify dev_name as the all
> that is being computed is the length of the hostname, so the computed
> length can just be shorted.
>
> Fixes: dc04589827f7 ("NFS: Use common device name parsing logic for
> NFSv4 and NFSv2/v3")
> Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Thanks Eric! Applied to my linux-next branch for inclusion in the 5.1
merge window.
--
Trond Myklebust
Linux NFS client maintainer, Hammerspace
trond.myklebust@hammerspace.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-02-21 22:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-30 13:58 [PATCH] fs/nfs: Fix nfs_parse_devname to not modify it's argument Eric W. Biederman
2019-02-21 22:41 ` Trond Myklebust
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).