[PATCH] vfs: namespace: error pointer dereference in do_remount()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We need to check if vfs_new_fs_context() returns an error pointer.

Fixes: fd0002870b45 ("vfs: Implement a filesystem superblock creation/configuration context")
Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>

diff --git a/fs/namespace.c b/fs/namespace.c
index a240e20093e0..841517520c08 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -2384,6 +2384,8 @@ static int do_remount(struct path *path, int ms_flags, int sb_flags,
 	fc = vfs_new_fs_context(path->dentry->d_sb->s_type,
 				path->dentry, sb_flags, MS_RMT_MASK,
 				FS_CONTEXT_FOR_RECONFIGURE);
+	if (IS_ERR(fc))
+		return PTR_ERR(fc);
 
 	err = parse_monolithic_mount_data(fc, data, data_size);
 	if (err < 0)



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux