From: Alan Cox Date: Sun, 19 Oct 2008 03:28:01 +0000 (-0700) Subject: hfsplus: missing O_LARGEFILE check X-Git-Tag: v2.6.28-rc1~156 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=6e7152944426be786c6c232990914e4565290d35;p=linux-2.6-omap-h63xx.git hfsplus: missing O_LARGEFILE check hfsplus: O_LARGEFILE checking is missing Addresses http://bugzilla.kernel.org/show_bug.cgi?id=8490 From: Alan Cox Reported-by: didier Cc: Roman Zippel Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/hfsplus/inode.c b/fs/hfsplus/inode.c index b085d64a2b6..963be644297 100644 --- a/fs/hfsplus/inode.c +++ b/fs/hfsplus/inode.c @@ -254,6 +254,8 @@ static int hfsplus_file_open(struct inode *inode, struct file *file) { if (HFSPLUS_IS_RSRC(inode)) inode = HFSPLUS_I(inode).rsrc_inode; + if (!(file->f_flags & O_LARGEFILE) && i_size_read(inode) > MAX_NON_LFS) + return -EOVERFLOW; atomic_inc(&HFSPLUS_I(inode).opencnt); return 0; }