diff mbox series

[1/6] vfs: Fix vfs_dup_fs_context()

Message ID 153484530575.1183.124318951692100857.stgit@warthog.procyon.org.uk (mailing list archive)
State New, archived
Headers show
Series [1/6] vfs: Fix vfs_dup_fs_context() | expand

Commit Message

David Howells Aug. 21, 2018, 9:55 a.m. UTC
vfs_dup_fs_context() allocates the wrong type of structure and as a result
ends up with one that's too small.

This isn't a problem at this time as nothing uses vfs_dup_fs_context() yet
(until nfs and btrfs conversions come along).

Fixes: ad3e21240b41 ("vfs: Implement a filesystem superblock creation/configuration context")
Signed-off-by: David Howells <dhowells@redhat.com>
---

 fs/fs_context.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/fs/fs_context.c b/fs/fs_context.c
index a6597a2fbf2b..14921b2c1e42 100644
--- a/fs/fs_context.c
+++ b/fs/fs_context.c
@@ -348,7 +348,7 @@  struct fs_context *vfs_dup_fs_context(struct fs_context *src_fc)
 	if (!src_fc->ops->dup)
 		return ERR_PTR(-EOPNOTSUPP);
 
-	fc = kmemdup(src_fc, sizeof(struct legacy_fs_context), GFP_KERNEL);
+	fc = kmemdup(src_fc, sizeof(struct fs_context), GFP_KERNEL);
 	if (!fc)
 		return ERR_PTR(-ENOMEM);