]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
ext4: Fix insufficient checks in EXT4_IOC_MOVE_EXT
authorAkira Fujita <a-fujita@rs.jp.nec.com>
Mon, 7 Dec 2009 04:38:31 +0000 (23:38 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 14 Dec 2009 16:08:01 +0000 (08:08 -0800)
commit51a88ff8de521caa02d8d208e410ff85a3c85199
tree2f332ba5a1cec1ab5f9333839093b9cceea7b78b
parente8f0d507456ee6ea071e0bb9d445e848b29872ac
ext4: Fix insufficient checks in EXT4_IOC_MOVE_EXT

(cherry picked from commit 4a58579b9e4e2a35d57e6c9c8483e52f6f1b7fd6)

This patch fixes three problems in the handling of the
EXT4_IOC_MOVE_EXT ioctl:

1. In current EXT4_IOC_MOVE_EXT, there are read access mode checks for
original and donor files, but they allow the illegal write access to
donor file, since donor file is overwritten by original file data.  To
fix this problem, change access mode checks of original (r->r/w) and
donor (r->w) files.

2.  Disallow the use of donor files that have a setuid or setgid bits.

3.  Call mnt_want_write() and mnt_drop_write() before and after
ext4_move_extents() calling to get write access to a mount.

Signed-off-by: Akira Fujita <a-fujita@rs.jp.nec.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/ext4/ioctl.c
fs/ext4/move_extent.c