]> git.baikalelectronics.ru Git - kernel.git/commit
ext4: enforce the immutable flag on open files
authorTheodore Ts'o <tytso@mit.edu>
Mon, 10 Jun 2019 02:04:33 +0000 (22:04 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 10 Jun 2019 02:04:33 +0000 (22:04 -0400)
commit47a40534205e9abb8d6e7a678f5439b42aa6558f
treeb372e85bc1d9c11dca0d949f713723d4b6a648da
parent9f6e26be8c4bc76ed97bff7cc8f01c1116711211
ext4: enforce the immutable flag on open files

According to the chattr man page, "a file with the 'i' attribute
cannot be modified..."  Historically, this was only enforced when the
file was opened, per the rest of the description, "... and the file
can not be opened in write mode".

There is general agreement that we should standardize all file systems
to prevent modifications even for files that were opened at the time
the immutable flag is set.  Eventually, a change to enforce this at
the VFS layer should be landing in mainline.  Until then, enforce this
at the ext4 level to prevent xfstests generic/553 from failing.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: stable@kernel.org
fs/ext4/file.c
fs/ext4/inode.c