lkml.org 
[lkml]   [2005]   [Nov]   [28]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
DateMon, 28 Nov 2005 13:25:33 +0100
FromJan Kara <>
Subject[PATCH] Fix oops in vfs_quotaon_mount()
  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 <jack@suse.cz>
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 <jack@suse.cz>

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;
 }
\
 
 \ /
  Last update: 2005-11-28 13:26    [from the cache]
©2003-2008