Will Woods 1e2ee49f7f fanotify: fix -EOVERFLOW with large files on 64-bit
On 64-bit systems, O_LARGEFILE is automatically added to flags inside
the open() syscall (also openat(), blkdev_open(), etc).  Userspace
therefore defines O_LARGEFILE to be 0 - you can use it, but it's a
no-op.  Everything should be O_LARGEFILE by default.

But: when fanotify does create_fd() it uses dentry_open(), which skips
all that.  And userspace can't set O_LARGEFILE in fanotify_init()
because it's defined to 0.  So if fanotify gets an event regarding a
large file, the read() will just fail with -EOVERFLOW.

This patch adds O_LARGEFILE to fanotify_init()'s event_f_flags on 64-bit
systems, using the same test as open()/openat()/etc.

Addresses https://bugzilla.redhat.com/show_bug.cgi?id=696821

Signed-off-by: Will Woods <wwoods@redhat.com>
Acked-by: Eric Paris <eparis@redhat.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2014-05-06 13:04:59 -07:00
..
2014-05-06 13:04:59 -07:00
2014-04-16 23:08:57 -05:00
2014-04-28 16:43:44 +02:00
2013-12-04 12:27:46 +01:00
2014-04-07 10:17:30 -07:00
2014-01-25 03:14:05 -05:00
2014-05-05 09:31:33 +03:00
2013-12-05 16:36:21 -06:00
2013-06-29 12:57:04 +04:00
2013-10-24 23:34:54 -04:00
2014-04-19 13:23:31 -07:00
2014-04-04 15:50:08 -07:00
2013-11-09 00:16:20 -05:00
2013-10-24 23:34:54 -04:00
2014-02-07 16:08:57 -08:00
2014-02-07 16:08:57 -08:00
2014-04-01 23:19:09 -04:00
2013-11-23 22:33:47 -08:00
2014-04-01 23:19:08 -04:00
2014-04-01 23:19:08 -04:00
2014-04-01 23:19:09 -04:00
2013-10-24 23:34:54 -04:00
2013-11-09 00:16:31 -05:00
2014-04-16 11:53:08 -07:00