From 6e7152944426be786c6c232990914e4565290d35 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Sat, 18 Oct 2008 20:28:01 -0700 Subject: 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 --- fs/hfsplus/inode.c | 2 ++ 1 file changed, 2 insertions(+) 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; } -- cgit v1.2.3-70-g09d2