linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] vfs: make immutable files actually immutable
@ 2019-03-28 17:50 Darrick J. Wong
  2019-03-28 17:50 ` [PATCH 1/3] mm/fs: don't allow writes to immutable files Darrick J. Wong
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Darrick J. Wong @ 2019-03-28 17:50 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.

This has been lightly tested with fstests.  Enjoy!
Comments and questions are, as always, welcome.

--D

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

end of thread, other threads:[~2019-04-05  0:29 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-28 17:50 [PATCH 0/3] vfs: make immutable files actually immutable Darrick J. Wong
2019-03-28 17:50 ` [PATCH 1/3] mm/fs: don't allow writes to immutable files Darrick J. Wong
2019-03-28 17:50 ` [PATCH 2/3] xfs: reset page mappings after setting immutable Darrick J. Wong
2019-03-28 21:21   ` Dave Chinner
2019-04-05  0:29     ` Darrick J. Wong
2019-03-28 17:50 ` [PATCH 3/3] xfs: don't allow most setxattr to immutable files Darrick J. Wong
2019-03-28 21:24   ` Amir Goldstein
2019-03-28 21:29   ` Dave Chinner
2019-03-29  4:02     ` Darrick J. Wong

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).