Skip to contentSkip to conversation

ext4: Fix the NULL reference in double_down_write_data_sem()

PATCH In review Akira Fujita 1 participant 1 message Mar 3, 2010 ext4 file system

lore
Share & tools
lore
#0 lore raw

PATCH 2/3 ext4: Fix the NULL reference in double_down_write_data_sem()

ext4: Fix the NULL reference in double_down_write_data_sem()

From: Akira Fujita <[email protected]>

If EXT4_IOC_MOVE_EXT ioctl is called with NULL donor_fd, fget() in ext4_ioctl() gets inappropriate file structure for donor. Therefore the NULL reference occurs in double_down_write_data_sem().

---
 fs/ext4/move_extent.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)
fs/ext4/move_extent.c +0 -7
index 9eca1c0..7e99f4e 100644
@@ -953,14 +953,6 @@ mext_check_arguments(struct inode *orig_inode,
 	unsigned int blkbits = orig_inode->i_blkbits;
 	unsigned int blocksize = 1 << blkbits;
 
-	/* Regular file check */
-	if (!S_ISREG(orig_inode->i_mode) || !S_ISREG(donor_inode->i_mode)) {
-		ext4_debug("ext4 move extent: The argument files should be "
-			"regular file [ino:orig %lu, donor %lu]\n",
-			orig_inode->i_ino, donor_inode->i_ino);
-		return -EINVAL;
-	}