diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2019-01-30 07:58:38 -0600 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-01-27 14:46:21 +0100 |
commit | 69c5a33b72bd84a36a158c7a0401c67d776ddeec (patch) | |
tree | e240e886a6193db5eee8564e1508273969b078e4 /fs | |
parent | 23e85b26ea102e64d39e1d12e109d65b51d27575 (diff) | |
download | linux-stable-69c5a33b72bd84a36a158c7a0401c67d776ddeec.tar.gz linux-stable-69c5a33b72bd84a36a158c7a0401c67d776ddeec.tar.bz2 linux-stable-69c5a33b72bd84a36a158c7a0401c67d776ddeec.zip |
fs/nfs: Fix nfs_parse_devname to not modify it's argument
[ Upstream commit 40cc394be1aa18848b8757e03bd8ed23281f572e ]
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>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nfs/super.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/nfs/super.c b/fs/nfs/super.c index f464f8d9060c..470b761839a5 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c @@ -1925,7 +1925,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) |