linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/8] vfs: make immutable files actually immutable
@ 2019-04-17 19:04 Darrick J. Wong
  2019-04-17 19:04 ` [PATCH 1/8] mm/fs: don't allow writes to immutable files Darrick J. Wong
                   ` (8 more replies)
  0 siblings, 9 replies; 21+ messages in thread
From: Darrick J. Wong @ 2019-04-17 19:04 UTC (permalink / raw)
  To: darrick.wong; +Cc: linux-xfs, linux-fsdevel, linux-ext4, linux-btrfs, linux-mm

Hi all,

The chattr(1) manpage has this to say about the immutable bit that
system administrators can set on files:

"A file with the 'i' attribute cannot be modified: it cannot be deleted
or renamed, no link can be created to this file, most of the file's
metadata can not be modified, and the file can not be opened in write
mode."

Given the clause about how the file 'cannot be modified', it is
surprising that programs holding writable file descriptors can continue
to write to and truncate files after the immutable flag has been set,
but they cannot call other things such as utimes, fallocate, unlink,
link, setxattr, or reflink.

Since the immutable flag is only settable by administrators, resolve
this inconsistent behavior in favor of the documented behavior -- once
the flag is set, the file cannot be modified, period.

If you're going to start using this mess, you probably ought to just
pull from my git trees, which are linked below.

This is an extraordinary way to destroy everything.  Enjoy!
Comments and questions are, as always, welcome.

--D

kernel git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfs-linux.git/log/?h=immutable-files

fstests git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfstests-dev.git/log/?h=immutable-files

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2019-06-11  4:02 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-17 19:04 [PATCH v2 0/8] vfs: make immutable files actually immutable Darrick J. Wong
2019-04-17 19:04 ` [PATCH 1/8] mm/fs: don't allow writes to immutable files Darrick J. Wong
2019-04-26 18:17   ` Brian Foster
2019-06-10  1:43   ` Theodore Ts'o
2019-06-10  1:51   ` Theodore Ts'o
2019-06-10  4:41     ` Darrick J. Wong
2019-06-10 13:14       ` Theodore Ts'o
2019-06-10 16:09         ` Darrick J. Wong
2019-06-10 20:41           ` Theodore Ts'o
2019-06-11  3:26             ` Darrick J. Wong
2019-06-11  4:01             ` Darrick J. Wong
2019-04-17 19:04 ` [PATCH 2/8] xfs: unlock inode when xfs_ioctl_setattr_get_trans can't get transaction Darrick J. Wong
2019-04-26 18:17   ` Brian Foster
2019-04-17 19:04 ` [PATCH 3/8] xfs: flush page mappings as part of setting immutable Darrick J. Wong
2019-04-26 18:18   ` Brian Foster
2019-04-17 19:04 ` [PATCH 4/8] xfs: refactor setflags to use setattr code directly Darrick J. Wong
2019-04-17 19:05 ` [PATCH 5/8] xfs: clean up xfs_merge_ioc_xflags Darrick J. Wong
2019-04-17 19:05 ` [PATCH 6/8] xfs: don't allow most setxattr to immutable files Darrick J. Wong
2019-04-17 19:05 ` [PATCH 7/8] btrfs: don't allow any modifications to an immutable file Darrick J. Wong
2019-04-17 19:05 ` [PATCH 8/8] ext4: " Darrick J. Wong
2019-04-30 15:46 ` [PATCH v2 0/8] vfs: make immutable files actually immutable David Sterba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).