diff options
-rw-r--r-- | fs/ceph/export.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/ceph/export.c b/fs/ceph/export.c index 44451749c544..9f236a2a2557 100644 --- a/fs/ceph/export.c +++ b/fs/ceph/export.c @@ -452,7 +452,13 @@ 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() from struct export_operations + * assumes that its 'name' parameter is pointing + * to a NAME_MAX+1 sized buffer + */ + strscpy(name, fsc->mount_options->snapdir_name, + NAME_MAX + 1); err = 0; } goto out; |