Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1230396

Re: [RFC PATCH 1/2] VFS: Kill use of O_LARGEFILE inside the kernel

From Theodore Ts'o <tytso@mit.edu>
Newsgroups linux.kernel
Subject Re: [RFC PATCH 1/2] VFS: Kill use of O_LARGEFILE inside the kernel
Date 2015-09-22 18:00 +0200
Message-ID <qby96-1o7-87@gated-at.bofh.it> (permalink)
References <qbxG1-P2-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Sep 22, 2015 at 04:24:50PM +0100, David Howells wrote:
> 
>  (4) fs/open.c:  Length check in ftruncate().
> 
>  (5) fs/open.c:  Length check in generic_file_open().
> 
> All but the first two are just making length checks that are waived
> unconditionally on a 64-bit system.  Just skip the length checks, assuming
> that O_LARGEFILE is actually set.

So what this means is that on 32-bit systems, if we have a userspace
program which isn't using the Largefile-enabled, and it opens a file
which is larger than can be addressed with a 32-bit off_t, it can get
surprised and possibly cause data loss.

Is this something we are willing to live with?  After all, there was a
originally a really good reason for the O_LARGEFILE flag in the first
place, and it was primarily about making sure that a non-LARGEFILE
capable program would hard fail on the open, instead of after it had
trashed the user's data.  Granted that 32-bit systems are rarer these
days, and hopefully this isn't a situation that would come up that
often in embedded systems, but if breaking this functionality is
something that we are deliberately going to be doing, we should
discuss it explicitly, and document the decision in the commit
message.

Was there a reason that motivated this change, other than just an
clean up?

						- Ted
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[RFC PATCH 1/2] VFS: Kill use of O_LARGEFILE inside the kernel David Howells <dhowells@redhat.com> - 2015-09-22 17:30 +0200
  Re: [RFC PATCH 1/2] VFS: Kill use of O_LARGEFILE inside the kernel Theodore Ts'o <tytso@mit.edu> - 2015-09-22 18:00 +0200
    Re: [RFC PATCH 1/2] VFS: Kill use of O_LARGEFILE inside the kernel David Howells <dhowells@redhat.com> - 2015-09-22 18:20 +0200
      Re: [RFC PATCH 1/2] VFS: Kill use of O_LARGEFILE inside the kernel Theodore Ts'o <tytso@mit.edu> - 2015-09-22 21:30 +0200
      Re: [RFC PATCH 1/2] VFS: Kill use of O_LARGEFILE inside the kernel Dave Chinner <david@fromorbit.com> - 2015-09-22 23:50 +0200

csiph-web