Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932120Ab0GASbp (ORCPT ); Thu, 1 Jul 2010 14:31:45 -0400 Received: from kroah.org ([198.145.64.141]:40764 "EHLO coco.kroah.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758116Ab0GASYO (ORCPT ); Thu, 1 Jul 2010 14:24:14 -0400 X-Mailbox-Line: From gregkh@clark.site Thu Jul 1 10:32:17 2010 Message-Id: <20100701173216.935298693@clark.site> User-Agent: quilt/0.48-10.1 Date: Thu, 01 Jul 2010 10:32:26 -0700 From: Greg KH To: linux-kernel@vger.kernel.org, stable@kernel.org Cc: stable-review@kernel.org, torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk, "Theodore Tso" , Dan Rosenberg Subject: [patch 120/149] ext4: Make sure the MOVE_EXT ioctl cant overwrite append-only files In-Reply-To: <20100701175144.GA2116@kroah.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1269 Lines: 40 2.6.32-stable review patch. If anyone has any objections, please let us know. ------------------ From: Theodore Ts'o commit 1f5a81e41f8b1a782c68d3843e9ec1bfaadf7d72 upstream. 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" Cc: Dan Rosenberg Signed-off-by: Greg Kroah-Hartman --- fs/ext4/move_extent.c | 3 +++ 1 file changed, 3 insertions(+) --- a/fs/ext4/move_extent.c +++ b/fs/ext4/move_extent.c @@ -964,6 +964,9 @@ mext_check_arguments(struct inode *orig_ 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 " -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/