Skip to content

Commit 6994348

Browse files
fs/ntfs3: Deny getting attr data block in compressed frame
Attempting to retrieve an attribute data block in a compressed frame is ignored. Fixes: be71b5c ("fs/ntfs3: Add attrib operations") Signed-off-by: Konstantin Komarov <[email protected]>
1 parent 25610ff commit 6994348

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

fs/ntfs3/attrib.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -975,6 +975,19 @@ int attr_data_get_block(struct ntfs_inode *ni, CLST vcn, CLST clen, CLST *lcn,
975975
if (err)
976976
goto out;
977977

978+
/* Check for compressed frame. */
979+
err = attr_is_frame_compressed(ni, attr, vcn >> NTFS_LZNT_CUNIT, &hint);
980+
if (err)
981+
goto out;
982+
983+
if (hint) {
984+
/* if frame is compressed - don't touch it. */
985+
*lcn = COMPRESSED_LCN;
986+
*len = hint;
987+
err = -EOPNOTSUPP;
988+
goto out;
989+
}
990+
978991
if (!*len) {
979992
if (run_lookup_entry(run, vcn, lcn, len, NULL)) {
980993
if (*lcn != SPARSE_LCN || !new)

0 commit comments

Comments
 (0)