From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out4-smtp.messagingengine.com ([66.111.4.28]:35177 "EHLO out4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759060AbdKPU2Q (ORCPT ); Thu, 16 Nov 2017 15:28:16 -0500 Date: Thu, 16 Nov 2017 21:28:21 +0100 From: Greg KH To: Stefan Nuernberger Cc: stable@vger.kernel.org, Amit Shah , David Woodhouse , Will Woods Subject: Re: [PATCH] fanotify: fix -EOVERFLOW with large files on 64-bit Message-ID: <20171116202821.GA11348@kroah.com> References: <20171116194353.20100-1-snu@amazon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171116194353.20100-1-snu@amazon.com> Sender: stable-owner@vger.kernel.org List-ID: On Thu, Nov 16, 2017 at 08:43:53PM +0100, Stefan Nuernberger wrote: > From: Will Woods > > commit 1e2ee49f7f1b79f0b14884fe6a602f0411b39552 upstream. > > 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 > Acked-by: Eric Paris > Reviewed-by: Jan Kara > Signed-off-by: Andrew Morton > Signed-off-by: Linus Torvalds > > [snu: Backported to 3.2 / 3.10: adjusted context] > > Signed-off-by: Stefan Nuernberger > Reviewed-by: Pawel Wieczorkiewicz > Reviewed-by: Simon Veith > > Cc: # 3.2.x and 3.10.x 3.10.y is end-of-life :( See the front page of www.kernel.org for that list if you are curious. thanks, greg k-h