Commit 6e7152944426be786c6c232990914e4565290d35

Authored by Alan Cox
Committed by Linus Torvalds
1 parent cdbf6dba28

hfsplus: missing O_LARGEFILE check

hfsplus: O_LARGEFILE checking is missing

Addresses http://bugzilla.kernel.org/show_bug.cgi?id=8490

From: Alan Cox <alan@redhat.com>
Reported-by: didier <did447@gmail.com>
Cc: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 1 changed file with 2 additions and 0 deletions Side-by-side Diff

... ... @@ -254,6 +254,8 @@
254 254 {
255 255 if (HFSPLUS_IS_RSRC(inode))
256 256 inode = HFSPLUS_I(inode).rsrc_inode;
  257 + if (!(file->f_flags & O_LARGEFILE) && i_size_read(inode) > MAX_NON_LFS)
  258 + return -EOVERFLOW;
257 259 atomic_inc(&HFSPLUS_I(inode).opencnt);
258 260 return 0;
259 261 }