[PATCH] Fix oops in vfs_quotaon_mount()

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

 



  Hello,

  attached patch fixes a possible oops in journaled quotas. If quota file
specified in mount options did not exist, quota code tried to dereference
NULL pointer with the obvious result. Attached is a fix against 2.6.14
kernel. Please apply.

								Honza

-- 
Jan Kara <[email protected]>
SuSE CR Labs
When quota file specified in mount options did not exist, we tried to
dereference NULL pointer later. Fix it.

Signed-off-by: Jan Kara <[email protected]>

diff -rupX /home/jack/.kerndiffexclude linux-2.6.14-1-punch-ioctl/fs/dquot.c linux-2.6.14-2-quotaon_oops/fs/dquot.c
--- linux-2.6.14-1-punch-ioctl/fs/dquot.c	2005-09-11 22:41:52.000000000 +0200
+++ linux-2.6.14-2-quotaon_oops/fs/dquot.c	2005-11-29 15:42:17.000000000 +0100
@@ -1526,10 +1526,16 @@ int vfs_quota_on_mount(struct super_bloc
 	if (IS_ERR(dentry))
 		return PTR_ERR(dentry);
 
+	if (!dentry->d_inode) {
+		error = -ENOENT;
+		goto out;
+	}
+
 	error = security_quota_on(dentry);
 	if (!error)
 		error = vfs_quota_on_inode(dentry->d_inode, type, format_id);
 
+out:
 	dput(dentry);
 	return error;
 }

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux