[lkml]   [2018]   [Aug]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH 1/6] vfs: Fix vfs_dup_fs_context()
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 <>

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

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)

- 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);

 \ /
  Last update: 2018-08-21 11:56    [W:0.032 / U:1.496 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site