]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
udf: Prevent write-unsupported filesystem to be remounted read-write
authorJan Kara <jack@suse.cz>
Thu, 6 Sep 2018 13:56:10 +0000 (15:56 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 21 Nov 2018 08:21:58 +0000 (09:21 +0100)
commit8515b9edf7a0c9dcf1ad218ccc783700db217336
tree7cb31eec3d99b692aa194808208aedb23842c532
parenta9dbfcffbfba56b40afbafb63efdce633e560f4a
udf: Prevent write-unsupported filesystem to be remounted read-write

[ Upstream commit a9ad01bc759df79b0012f43ee52164391e31cd96 ]

There are certain filesystem features which we support for reading but
not for writing. We properly refuse to mount such filesystems read-write
however for some features (such as read-only partitions), we don't check
for these features when remounting the filesystem from read-only to
read-write. Thus such filesystems could be remounted read-write leading
to strange behavior (most likely crashes).

Fix the problem by marking in superblock whether the filesystem has some
features that are supported in read-only mode and check this flag during
remount.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/udf/super.c
fs/udf/udf_sb.h