mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
ext4: Make sure the MOVE_EXT ioctl can't overwrite append-only files
Dan Roseberg has reported a problem with the MOVE_EXT ioctl. If the donor file is an append-only file, we should not allow the operation to proceed, lest we end up overwriting the contents of an append-only file. Signed-off-by: "Theodore Ts'o" <[email protected]> Cc: Dan Rosenberg <[email protected]>
This commit is contained in:
parent
67a3e12b05
commit
1f5a81e41f
1 changed files with 3 additions and 0 deletions
|
|
@ -960,6 +960,9 @@ mext_check_arguments(struct inode *orig_inode,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (IS_IMMUTABLE(donor_inode) || IS_APPEND(donor_inode))
|
||||
return -EPERM;
|
||||
|
||||
/* Ext4 move extent does not support swapfile */
|
||||
if (IS_SWAPFILE(orig_inode) || IS_SWAPFILE(donor_inode)) {
|
||||
ext4_debug("ext4 move extent: The argument files should "
|
||||
|
|
|
|||
Loading…
Reference in a new issue