Blame SOURCES/0075-fs-ntfs3-Fix-insertion-of-attr-in-ni_ins_attr_ext.patch
|
Kmods SIG |
63c143 |
From ee9d4810aab95208541d2807f9d114f1d5edcee0 Mon Sep 17 00:00:00 2001
|
|
Kmods SIG |
63c143 |
From: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
|
|
Kmods SIG |
63c143 |
Date: Wed, 8 Sep 2021 18:39:53 +0300
|
|
Kmods SIG |
63c143 |
Subject: [Backport ee9d4810aab9] src: Fix insertion of attr in
|
|
Kmods SIG |
63c143 |
ni_ins_attr_ext
|
|
Kmods SIG |
63c143 |
|
|
Kmods SIG |
63c143 |
Do not try to insert attribute if there is no room in record.
|
|
Kmods SIG |
63c143 |
|
|
Kmods SIG |
63c143 |
Reviewed-by: Kari Argillander <kari.argillander@gmail.com>
|
|
Kmods SIG |
63c143 |
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
|
|
Kmods SIG |
63c143 |
---
|
|
Kmods SIG |
63c143 |
src/frecord.c | 7 +++++++
|
|
Kmods SIG |
63c143 |
1 file changed, 7 insertions(+)
|
|
Kmods SIG |
63c143 |
|
|
Kmods SIG |
63c143 |
diff --git a/src/frecord.c b/src/frecord.c
|
|
Kmods SIG |
63c143 |
index 1e1a09034f65b023872d86b866ee5b3907634506..0d00b2301a2f1fa380335ab91abd0afa53538053 100644
|
|
Kmods SIG |
63c143 |
--- a/src/frecord.c
|
|
Kmods SIG |
63c143 |
+++ b/src/frecord.c
|
|
Kmods SIG |
63c143 |
@@ -953,6 +953,13 @@ static int ni_ins_attr_ext(struct ntfs_inode *ni, struct ATTR_LIST_ENTRY *le,
|
|
Kmods SIG |
63c143 |
continue;
|
|
Kmods SIG |
63c143 |
}
|
|
Kmods SIG |
63c143 |
|
|
Kmods SIG |
63c143 |
+ /*
|
|
Kmods SIG |
63c143 |
+ * Do not try to insert this attribute
|
|
Kmods SIG |
63c143 |
+ * if there is no room in record.
|
|
Kmods SIG |
63c143 |
+ */
|
|
Kmods SIG |
63c143 |
+ if (le32_to_cpu(mi->mrec->used) + asize > sbi->record_size)
|
|
Kmods SIG |
63c143 |
+ continue;
|
|
Kmods SIG |
63c143 |
+
|
|
Kmods SIG |
63c143 |
/* Try to insert attribute into this subrecord. */
|
|
Kmods SIG |
63c143 |
attr = ni_ins_new_attr(ni, mi, le, type, name, name_len, asize,
|
|
Kmods SIG |
63c143 |
name_off, svcn, ins_le);
|
|
Kmods SIG |
63c143 |
--
|
|
Kmods SIG |
63c143 |
2.31.1
|
|
Kmods SIG |
63c143 |
|