[<prev] [next>] [day] [month] [year] [list]
Message-ID: <4C7AB963.6030401@rid-net.de>
Date: Sun, 29 Aug 2010 21:47:47 +0200
From: Andreas Rid <andreas@...-net.de>
To: tytso@....edu
CC: linux-ext4@...r.kernel.org
Subject: [patch] ext4 defrag executables
hi,
since ioctl EXT4_IOC_MOVE_EXT checks the original file descriptor for write access it's no longer possible to defrag executable files which are currently in use. This is because you can only open() those files readonly.
This patch solves it without adding a security hole.
What do you think about it?
Andreas
diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c
index 352cb35..ae45380 100644
--- a/fs/ext4/ioctl.c
+++ b/fs/ext4/ioctl.c
@@ -242,8 +242,8 @@ setversion_out:
struct file *donor_filp;
int err;
- if (!(filp->f_mode & FMODE_READ) ||
- !(filp->f_mode & FMODE_WRITE))
+ if (generic_permission(filp->f_dentry->d_inode,
+ MAY_READ | MAY_WRITE, NULL))
return -EBADF;
if (copy_from_user(&me,
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists