diff options
author | Steven J. Magnani <steve.magnani@digidescorp.com> | 2019-08-14 14:50:02 +0200 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2019-08-26 11:17:55 +0200 |
commit | ab9a3a737284b3d9e1d2ba43a0ef31b3ef2e2417 (patch) | |
tree | da1ecd5168487841b078727bfcb357edc1172e15 /fs/udf/super.c | |
parent | udf: prevent allocation beyond UDF partition (diff) | |
download | linux-ab9a3a737284b3d9e1d2ba43a0ef31b3ef2e2417.tar.xz linux-ab9a3a737284b3d9e1d2ba43a0ef31b3ef2e2417.zip |
udf: reduce leakage of blocks related to named streams
Windows is capable of creating UDF files having named streams.
One example is the "Zone.Identifier" stream attached automatically
to files downloaded from a network. See:
https://msdn.microsoft.com/en-us/library/dn392609.aspx
Modification of a file having one or more named streams in Linux causes
the stream directory to become detached from the file, essentially leaking
all blocks pertaining to the file's streams.
Fix by saving off information about an inode's streams when reading it,
for later use when its on-disk data is updated.
Link: https://lore.kernel.org/r/20190814125002.10869-1-steve@digidescorp.com
Signed-off-by: Steven J. Magnani <steve@digidescorp.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/udf/super.c')
-rw-r--r-- | fs/udf/super.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/udf/super.c b/fs/udf/super.c index f34e06b4d8fa..00e2d7190b52 100644 --- a/fs/udf/super.c +++ b/fs/udf/super.c @@ -151,9 +151,11 @@ static struct inode *udf_alloc_inode(struct super_block *sb) ei->i_unique = 0; ei->i_lenExtents = 0; + ei->i_lenStreams = 0; ei->i_next_alloc_block = 0; ei->i_next_alloc_goal = 0; ei->i_strat4096 = 0; + ei->i_streamdir = 0; init_rwsem(&ei->i_data_sem); ei->cached_extent.lstart = -1; spin_lock_init(&ei->i_extent_cache_lock); |