diff options
author | Trond Myklebust <trondmy@gmail.com> | 2020-02-02 17:53:55 -0500 |
---|---|---|
committer | Anna Schumaker <Anna.Schumaker@Netapp.com> | 2020-02-03 16:37:45 -0500 |
commit | 3803d6721baff3d5dd6cd6b8c7294e54d124bc41 (patch) | |
tree | d2731a13dcbdc7e284c8838d7b99893ecf10dc6c /fs/nfs | |
parent | 114de38225d9b300f027e2aec9afbb6e0def154b (diff) | |
download | linux-3803d6721baff3d5dd6cd6b8c7294e54d124bc41.tar.bz2 |
NFS: Use kmemdup_nul() in nfs_readdir_make_qstr()
The directory strings stored in the readdir cache may be used with
printk(), so it is better to ensure they are nul-terminated.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Reviewed-by: Benjamin Coddington <bcodding@redhat.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/dir.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index d95c2c94bd87..5a8ff7e97ce3 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -198,7 +198,7 @@ static int nfs_readdir_make_qstr(struct qstr *string, const char *name, unsigned int len) { string->len = len; - string->name = kmemdup(name, len, GFP_KERNEL); + string->name = kmemdup_nul(name, len, GFP_KERNEL); if (string->name == NULL) return -ENOMEM; /* |