lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 10 Mar 2022 09:43:11 -0800
From:   "Darrick J. Wong" <djwong@...nel.org>
To:     Eric Biggers <ebiggers@...nel.org>
Cc:     Theodore Ts'o <tytso@....edu>,
        linux-ext4 <linux-ext4@...r.kernel.org>
Subject: Re: [PATCH] ext4: fix fallocate to use file_modified to update
 permissions consistently

On Wed, Mar 09, 2022 at 08:31:09PM -0800, Eric Biggers wrote:
> On Tue, Mar 08, 2022 at 10:50:43AM -0800, Darrick J. Wong wrote:
> > From: Darrick J. Wong <djwong@...nel.org>
> > 
> > Since the initial introduction of (posix) fallocate back at the turn of
> > the century, it has been possible to use this syscall to change the
> > user-visible contents of files.  This can happen by extending the file
> > size during a preallocation, or through any of the newer modes (punch,
> > zero, collapse, insert range).  Because the call can be used to change
> > file contents, we should treat it like we do any other modification to a
> > file -- update the mtime, and drop set[ug]id privileges/capabilities.
> > 
> > The VFS function file_modified() does all this for us if pass it a
> > locked inode, so let's make fallocate drop permissions correctly.
> > 
> > Signed-off-by: Darrick J. Wong <djwong@...nel.org>
> > ---
> >  fs/ext4/ext4.h    |    2 +-
> >  fs/ext4/extents.c |   32 +++++++++++++++++++++++++-------
> >  fs/ext4/inode.c   |    7 ++++++-
> >  3 files changed, 32 insertions(+), 9 deletions(-)
> 
> Is there a test in xfstests that tests for this?

Not currently.  I /do/ actually have one drafted (which I'll email out
as a reply) but I was gonna tackle fixing btrfs before I actually submit
it to Eryu for upstream fstests.

--D

> - Eric

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ