Skip to contentSkip to conversation

Multiple CVE Fixes

PATCH In review Ranjith Rathod 1 participant 10 messages Jul 1, 2022 – Jul 16, 2022 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

cover Multiple CVE Fixes

There are following unpatched CVEs that fixing them individually would be a much bigger problem than just doing the update.

Fixed CVE's:
CVE-2021-33285
CVE-2021-33289
CVE-2021-33286
CVE-2021-35266
CVE-2021-33287
CVE-2021-35267
CVE-2021-35268
CVE-2021-35269
CVE-2021-39251
CVE-2021-39252
CVE-2021-39253
CVE-2021-39254
CVE-2021-39255
CVE-2021-39256
CVE-2021-39257
CVE-2021-39258
CVE-2021-39259
CVE-2021-39260
CVE-2021-39261
CVE-2021-39262
CVE-2021-39263

CVE-2022-30783
CVE-2022-30784
CVE-2022-30785
CVE-2022-30786
CVE-2022-30787
CVE-2022-30788
CVE-2022-30789

Chen Qi (1):
ntfs-3g-ntfsprogs: upgrade to 2021.8.22

Omkar Patil (7):
ntfs-3g-ntfsprogs: Fix CVE-2021-46790
ntfs-3g-ntfsprogs: Fix CVE-2022-30783
ntfs-3g-ntfsprogs: Fix CVE-2022-30784
ntfs-3g-ntfsprogs: Add Patch For Multiple CVE
ntfs-3g-ntfsprogs: Fix CVE-2022-30786
ntfs-3g-ntfsprogs: Fix CVE-2022-30788
ntfs-3g-ntfsprogs: Fix CVE-2022-30789

 .../ntfs-3g-ntfsprogs/CVE-2021-46790.patch    | 31 ++++++++
 .../ntfs-3g-ntfsprogs/CVE-2022-30783.patch    | 75 +++++++++++++++++++
 .../ntfs-3g-ntfsprogs/CVE-2022-30784.patch    | 74 ++++++++++++++++++
 .../CVE-2022-30785_30787.patch                | 32 ++++++++
 .../ntfs-3g-ntfsprogs/CVE-2022-30786-1.patch  | 36 +++++++++
 .../ntfs-3g-ntfsprogs/CVE-2022-30786-2.patch  | 45 +++++++++++
 .../ntfs-3g-ntfsprogs/CVE-2022-30788-1.patch  | 51 +++++++++++++
 .../ntfs-3g-ntfsprogs/CVE-2022-30788-2.patch  | 30 ++++++++
 .../ntfs-3g-ntfsprogs/CVE-2022-30789.patch    | 68 +++++++++++++++++
 ...3.23.bb => ntfs-3g-ntfsprogs_2021.8.22.bb} | 16 +++-
 10 files changed, 455 insertions(+), 3 deletions(-)
 create mode 100644 meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/ntfs-3g-ntfsprogs/CVE-2021-46790.patch
 create mode 100644 meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/ntfs-3g-ntfsprogs/CVE-2022-30783.patch
 create mode 100644 meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/ntfs-3g-ntfsprogs/CVE-2022-30784.patch
 create mode 100644 meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/ntfs-3g-ntfsprogs/CVE-2022-30785_30787.patch
 create mode 100644 meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/ntfs-3g-ntfsprogs/CVE-2022-30786-1.patch
 create mode 100644 meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/ntfs-3g-ntfsprogs/CVE-2022-30786-2.patch
 create mode 100644 meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/ntfs-3g-ntfsprogs/CVE-2022-30788-1.patch
 create mode 100644 meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/ntfs-3g-ntfsprogs/CVE-2022-30788-2.patch
 create mode 100644 meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/ntfs-3g-ntfsprogs/CVE-2022-30789.patch
 rename meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/{ntfs-3g-ntfsprogs_2017.3.23.bb => ntfs-3g-ntfsprogs_2021.8.22.bb} (77%)

--
2.17.1

This message contains information that may be privileged or confidential and is the property of the KPIT Technologies Ltd. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. KPIT Technologies Ltd. does not accept any liability for virus infected mails.

#1 lore raw

PATCH 1/8 ntfs-3g-ntfsprogs: upgrade to 2021.8.22

From: Chen Qi <[email protected]>

This upgrade revolves a bunch of CVEs. See more details in:
https://github.com/tuxera/ntfs-3g/security/advisories/GHSA-q759-8j5v-q5jp.

Fixed CVE's:
CVE-2021-33285
CVE-2021-33289
CVE-2021-33286
CVE-2021-35266
CVE-2021-33287
CVE-2021-35267
CVE-2021-35268
CVE-2021-35269
CVE-2021-39251
CVE-2021-39252
CVE-2021-39253
CVE-2021-39254
CVE-2021-39255
CVE-2021-39256
CVE-2021-39257
CVE-2021-39258
CVE-2021-39259
CVE-2021-39260
CVE-2021-39261
CVE-2021-39262
CVE-2021-39263

(cherry picked from commit 6791dc536444a1dd0f473653501ba43fc84704f2)
---
 ...-ntfsprogs_2017.3.23.bb => ntfs-3g-ntfsprogs_2021.8.22.bb} | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
 rename meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/{ntfs-3g-ntfsprogs_2017.3.23.bb => ntfs-3g-ntfsprogs_2021.8.22.bb} (92%)
meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/ntfs-3g-ntfsprogs_2021.8.22.bb renamed from meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/ntfs-3g-ntfsprogs_2017.3.23.bb +2 -2
similarity index 92%
rename from meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/ntfs-3g-ntfsprogs_2017.3.23.bb
rename to meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/ntfs-3g-ntfsprogs_2021.8.22.bb
index 6f5cb6cee..19b2d6ca2 100644
@@ -10,8 +10,8 @@ SRC_URI = "http://tuxera.com/opensource/ntfs-3g_ntfsprogs-${PV}.tgz \
            file://0001-libntfs-3g-Makefile.am-fix-install-failed-while-host.patch \
 "
 S = "${WORKDIR}/ntfs-3g_ntfsprogs-${PV}"
-SRC_URI[md5sum] = "d97474ae1954f772c6d2fa386a6f462c"
-SRC_URI[sha256sum] = "3e5a021d7b761261836dcb305370af299793eedbded731df3d6943802e1262d5"
+SRC_URI[md5sum] = "90da343e78877d388eb34cefae6799ae"
+SRC_URI[sha256sum] = "55b883aa05d94b2ec746ef3966cb41e66bed6db99f22ddd41d1b8b94bb202efb"
 
 UPSTREAM_CHECK_URI = "https://www.tuxera.com/community/open-source-ntfs-3g/"
 UPSTREAM_CHECK_REGEX = "ntfs-3g_ntfsprogs-(?P<pver>\d+(\.\d+)+)\.tgz"

--
2.17.1

This message contains information that may be privileged or confidential and is the property of the KPIT Technologies Ltd. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. KPIT Technologies Ltd. does not accept any liability for virus infected mails.

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw

Re: [oe][meta-filesystems][dunfell][PATCH 1/8] ntfs-3g-ntfsprogs: upgrade to 2021.8.22

Thanks Armin for the update. I'll look into this.

Thanks,

Best Regards,

Ranjitsinh Rathod
Technical Leader | | KPIT Technologies Ltd.
Cellphone: +91-84606 92403
__________________________________________
KPIT<http://www.kpit.com/> | Follow us on LinkedIn<http://www.kpit.com/linkedin>

[cid:0561260a-9c95-419c-867d-aba20d0e13f1]<https://www.kpit.com/TheNewBrand>

________________________________
From: akuster808 <[email protected]>
Sent: Saturday, July 16, 2022 2:48 AM
To: Ranjitsinh Rathod <[email protected]>; [email protected] <[email protected]>; Omkar Patil <[email protected]>
Cc: Chen Qi <[email protected]>; Khem Raj <[email protected]>
Subject: Re: [oe][meta-filesystems][dunfell][PATCH 1/8] ntfs-3g-ntfsprogs: upgrade to 2021.8.22

Caution: This email originated from outside of the KPIT. Do not click links or open attachments unless you recognize the sender and know the content is safe.

I am finally able to look into this series pend the master and kirkstone back logs.

I am fine with the update but none of the patches apply. I tried two different systems.

ERROR: ntfs-3g-ntfsprogs-2021.8.22-r0 do_patch: Applying patch
'CVE-2021-46790.patch' on target directory '/builds/54vdLR_9/0/akuster/meta-branch-maint/build/tmp/work/core2-64-poky-linux/ntfs-3g-ntfsprogs/2021.8.22-r0/ntfs-3g_ntfsprogs-2021.8.22' Command Error: 'quilt --quiltrc /builds/54vdLR_9/0/akuster/meta-branch-maint/build/tmp/work/core2-64-poky-linux/ntfs-3g-ntfsprogs/2021.8.22-r0/recipe-sysroot-native/etc/quiltrc push' exited with 0 Output:
Applying patch CVE-2021-46790.patch
patching file ntfsprogs/ntfsck.c
Hunk #1 FAILED at 616.
1 out of 1 hunk FAILED -- rejects in file ntfsprogs/ntfsck.c
Patch CVE-2021-46790.patch does not apply (enforce with -f)
ERROR: Logfile of failure stored in:
/builds/54vdLR_9/0/akuster/meta-branch-maint/build/tmp/work/core2-64-poky-linux/ntfs-3g-ntfsprogs/2021.8.22-r0/temp/log.do_patch.2884481

the nest one failed too.

Applying patch patches/CVE-2022-30783.patch
patching file libfuse-lite/mount.c
patching file src/ntfs-3g_common.c
Hunk #1 FAILED at 128.
Hunk #2 FAILED at 521.
2 out of 2 hunks FAILED -- rejects in file src/ntfs-3g_common.c patching file src/ntfs-3g_common.h
Hunk #1 FAILED at 94.
1 out of 1 hunk FAILED -- rejects in file src/ntfs-3g_common.h

-armin

Quoted 62 lines · Ranjitsinh Rathod via lists.openembedded.org

From: Chen Qi <[email protected]>

This upgrade revolves a bunch of CVEs. See more details in:
https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftuxera%2Fntfs-3g%2Fsecurity%2Fadvisories%2FGHSA-q759-8j5v-q5jp&amp;data=05%7C01%7Cranjitsinh.rathod%40kpit.com%7C9ff20d1727fb4f3a15a608da66a795da%7C3539451eb46e4a26a242ff61502855c7%7C0%7C0%7C637935167258637991%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=UOVp4aZzpV0iqGcs6vI9sE58zfJYDJc50ht5rb3ZtVg%3D&amp;reserved=0.

Fixed CVE's:
CVE-2021-33285
CVE-2021-33289
CVE-2021-33286
CVE-2021-35266
CVE-2021-33287
CVE-2021-35267
CVE-2021-35268
CVE-2021-35269
CVE-2021-39251
CVE-2021-39252
CVE-2021-39253
CVE-2021-39254
CVE-2021-39255
CVE-2021-39256
CVE-2021-39257
CVE-2021-39258
CVE-2021-39259
CVE-2021-39260
CVE-2021-39261
CVE-2021-39262
CVE-2021-39263

(cherry picked from commit 6791dc536444a1dd0f473653501ba43fc84704f2)
---
  ...-ntfsprogs_2017.3.23.bb => ntfs-3g-ntfsprogs_2021.8.22.bb} | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

rename meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/{ntfs-3g-ntfsprogs_2017.3.23.bb => ntfs-3g-ntfsprogs_2021.8.22.bb} (92%)

meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/ntfs-3g-ntfsprogs_2021.8.22.bb renamed from meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/ntfs-3g-ntfsprogs_2017.3.23.bb +2 -3
similarity index 92%
rename from meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/ntfs-3g-ntfsprogs_2017.3.23.bb
rename to meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/ntfs-3g-ntfsprogs_2021.8.22.bb
index 6f5cb6cee..19b2d6ca2 100644
@@ -10,8 +10,8 @@ SRC_URI = "https://apc01.safelinks.protection.outlook.com/?url=http%3A%2F%2Ftuxera.com%2Fopensource%2Fntfs-3g_ntfsprogs-%24&amp;data=05%7C01%7Cranjitsinh.rathod%40kpit.com%7C9ff20d1727fb4f3a15a608da66a795da%7C3539451eb46e4a26a242ff61502855c7%7C0%7C0%7C637935167258637991%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=HknXUbHma5653s11%2Fq1x%2FqX%2FW2zwuyM2zcNB%2F1rInHw%3D&amp;reserved=0{PV}.tgz \
             file://0001-libntfs-3g-Makefile.am-fix-install-failed-while-host.patch \
  "
  S = "${WORKDIR}/ntfs-3g_ntfsprogs-${PV}"
-SRC_URI[md5sum] = "d97474ae1954f772c6d2fa386a6f462c"
-SRC_URI[sha256sum] = "3e5a021d7b761261836dcb305370af299793eedbded731df3d6943802e1262d5"
+SRC_URI[md5sum] = "90da343e78877d388eb34cefae6799ae"
+SRC_URI[sha256sum] = "55b883aa05d94b2ec746ef3966cb41e66bed6db99f22ddd41d1b8b94bb202efb"
 
  UPSTREAM_CHECK_URI = "https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.tuxera.com%2Fcommunity%2Fopen-source-ntfs-3g%2F&amp;data=05%7C01%7Cranjitsinh.rathod%40kpit.com%7C9ff20d1727fb4f3a15a608da66a795da%7C3539451eb46e4a26a242ff61502855c7%7C0%7C0%7C637935167258637991%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=M%2Feo3UWBd%2BnXkkj5PzBg4QW63gYzQisdc5LA3Vzl3x8%3D&amp;reserved=0"
  UPSTREAM_CHECK_REGEX = "ntfs-3g_ntfsprogs-(?P<pver>\d+(\.\d+)+)\.tgz"
--

2.17.1

This message contains information that may be privileged or confidential and is the property of the KPIT Technologies Ltd. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. KPIT Technologies Ltd. does not accept any liability for virus infected mails.

Quoted 8 lines

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#97653): https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.openembedded.org%2Fg%2Fopenembedded-devel%2Fmessage%2F97653&amp;data=05%7C01%7Cranjitsinh.rathod%40kpit.com%7C9ff20d1727fb4f3a15a608da66a795da%7C3539451eb46e4a26a242ff61502855c7%7C0%7C0%7C637935167258637991%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=ANbcs%2FIjzhL8nlIwlVUj9CPXCZ5BZ7P5Rvu4wtPnLfU%3D&amp;reserved=0
Mute This Topic: https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.openembedded.org%2Fmt%2F92104299%2F3616698&amp;data=05%7C01%7Cranjitsinh.rathod%40kpit.com%7C9ff20d1727fb4f3a15a608da66a795da%7C3539451eb46e4a26a242ff61502855c7%7C0%7C0%7C637935167258637991%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=ckC%2BhiZgy%2FHRjOAasVSGYNn1Cj%2Bv2h5yjH6q4dZfM0k%3D&amp;reserved=0
Group Owner: [email protected]
Unsubscribe: https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.openembedded.org%2Fg%2Fopenembedded-devel%2Funsub&amp;data=05%7C01%7Cranjitsinh.rathod%40kpit.com%7C9ff20d1727fb4f3a15a608da66a795da%7C3539451eb46e4a26a242ff61502855c7%7C0%7C0%7C637935167258637991%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=mQswLRdEU9B9cqIEnLiY07WZJw%2F23q3Og4NKhXRgHx0%3D&amp;reserved=0 [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

This message contains information that may be privileged or confidential and is the property of the KPIT Technologies Ltd. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. KPIT Technologies Ltd. does not accept any liability for virus infected mails.

#4 lore raw

PATCH 2/8 ntfs-3g-ntfsprogs: Fix CVE-2021-46790

In reply to Ranjith Rathod

From: Omkar Patil <[email protected]>

CVE: CVE-2021-46790

---
 .../ntfs-3g-ntfsprogs/CVE-2021-46790.patch    | 31 +++++++++++++++++++
 .../ntfs-3g-ntfsprogs_2021.8.22.bb            |  4 ++-
 2 files changed, 34 insertions(+), 1 deletion(-)
 create mode 100644 meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/ntfs-3g-ntfsprogs/CVE-2021-46790.patch
meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/ntfs-3g-ntfsprogs/CVE-2021-46790.patch new file +31 -0
new file mode 100644
index 000000000..e0bb1b77f
@@ -0,0 +1,31 @@
+From 96412e28e5c7ac2d15f1cff8c825330bbb60976e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Jean-Pierre=20Andr=C3=A9?= <[email protected]>
+Date: Tue, 10 May 2022 10:30:24 +0200
+Subject: [PATCH] Fixed possible out-of-buffer condition in ntfsck
+
+A bad usa_count could lead to an out-of-buffer condition. Just avoid
+the issue and report the error, still not fix it.
+
+CVE: CVE-2021-46790
+Upstream-Status: Backport [http://archive.ubuntu.com/ubuntu/pool/main/n/ntfs-3g/ntfs-3g_2021.8.22-3ubuntu1.1.debian.tar.xz]
+Comment: No change in any hunk
+Signed-off-by: Omkar Patil <[email protected]>
+
+---
+ ntfsprogs/ntfsck.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/ntfsprogs/ntfsck.c b/ntfsprogs/ntfsck.c
+index d49f3f96..8c126411 100644
+--- a/ntfsprogs/ntfsck.c
++++ b/ntfsprogs/ntfsck.c
+@@ -616,7 +616,8 @@ static BOOL check_file_record(u8 *buffer, u16 buflen)
+
+       // Remove update seq & check it.
+       usa = *(u16*)(buffer+usa_ofs); // The value that should be at the end of every sector.
+-      assert_u32_equal(usa_count-1, buflen/NTFS_BLOCK_SIZE, "USA length");
++      if (assert_u32_equal(usa_count-1, buflen/NTFS_BLOCK_SIZE, "USA length"))
++              return (1);
+       for (i=1;i<usa_count;i++) {
+               u16 *fixup = (u16*)(buffer+NTFS_BLOCK_SIZE*i-2); // the value at the end of the sector.
+               u16 saved_val = *(u16*)(buffer+usa_ofs+2*i); // the actual data value that was saved in the us array.
meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/ntfs-3g-ntfsprogs_2021.8.22.bb +3 -1
index 19b2d6ca2..ca8af163e 100644
@@ -8,7 +8,9 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \
 
 SRC_URI = "http://tuxera.com/opensource/ntfs-3g_ntfsprogs-${PV}.tgz \
            file://0001-libntfs-3g-Makefile.am-fix-install-failed-while-host.patch \
-"
+           file://CVE-2021-46790.patch \
+          "
+
 S = "${WORKDIR}/ntfs-3g_ntfsprogs-${PV}"
 SRC_URI[md5sum] = "90da343e78877d388eb34cefae6799ae"
 SRC_URI[sha256sum] = "55b883aa05d94b2ec746ef3966cb41e66bed6db99f22ddd41d1b8b94bb202efb"

--
2.17.1

This message contains information that may be privileged or confidential and is the property of the KPIT Technologies Ltd. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. KPIT Technologies Ltd. does not accept any liability for virus infected mails.

#5 lore raw

PATCH 3/8 ntfs-3g-ntfsprogs: Fix CVE-2022-30783

In reply to Ranjith Rathod

From: Omkar Patil <[email protected]>

CVE: CVE-2022-30783

---
 .../ntfs-3g-ntfsprogs/CVE-2022-30783.patch    | 75 +++++++++++++++++++
 .../ntfs-3g-ntfsprogs_2021.8.22.bb            |  1 +
 2 files changed, 76 insertions(+)
 create mode 100644 meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/ntfs-3g-ntfsprogs/CVE-2022-30783.patch
meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/ntfs-3g-ntfsprogs/CVE-2022-30783.patch new file +75 -0
new file mode 100644
index 000000000..41f26503e
@@ -0,0 +1,75 @@
+From 7f81935f32e58e8fec22bc46683b1b067469405f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Jean-Pierre=20Andr=C3=A9?= <[email protected]>
+Date: Tue, 10 May 2022 10:44:34 +0200
+Subject: [PATCH] Returned an error code when the --help or --version options
+ are used
+
+Accepting --help or --version options may leave the ntfs-3g process in an
+unclean state, so reject them while processing options. Also reject
+them in libfuse-lite.
+
+CVE: CVE-2022-30783
+Upstream-Status: Backport [http://archive.ubuntu.com/ubuntu/pool/main/n/ntfs-3g/ntfs-3g_2021.8.22-3ubuntu1.1.debian.tar.xz]
+Comment: No change in any hunk
+Signed-off-by: Omkar Patil <[email protected]>
+
+---
+ libfuse-lite/mount.c | 3 +--
+ src/ntfs-3g_common.c | 6 ++++++
+ src/ntfs-3g_common.h | 2 ++
+ 3 files changed, 9 insertions(+), 2 deletions(-)
+
+diff --git a/libfuse-lite/mount.c b/libfuse-lite/mount.c
+index 64adee7d..6ae29d8c 100644
+--- a/libfuse-lite/mount.c
++++ b/libfuse-lite/mount.c
+@@ -670,11 +670,10 @@ int fuse_kern_mount(const char *mountpoint, struct fuse_args *args)
+         fprintf(stderr, "fuse: 'allow_other' and 'allow_root' options are mutually exclusive\n");
+         goto out;
+     }
+-    res = 0;
++    res = -1;
+     if (mo.ishelp)
+         goto out;
+
+-    res = -1;
+     if (get_mnt_flag_opts(&mnt_opts, mo.flags) == -1)
+         goto out;
+ #ifndef __SOLARIS__
+diff --git a/src/ntfs-3g_common.c b/src/ntfs-3g_common.c
+index 7e3e93d2..29021dfc 100644
+--- a/src/ntfs-3g_common.c
++++ b/src/ntfs-3g_common.c
+@@ -128,6 +128,10 @@ const struct DEFOPTION optionlist[] = {
+       { "efs_raw", OPT_EFS_RAW, FLGOPT_BOGUS },
+       { "posix_nlink", OPT_POSIX_NLINK, FLGOPT_BOGUS },
+       { "special_files", OPT_SPECIAL_FILES, FLGOPT_STRING },
++      { "--help", OPT_HELP, FLGOPT_BOGUS },
++      { "-h", OPT_HELP, FLGOPT_BOGUS },
++      { "--version", OPT_VERSION, FLGOPT_BOGUS },
++      { "-V", OPT_VERSION, FLGOPT_BOGUS },
+       { (const char*)NULL, 0, 0 } /* end marker */
+ } ;
+
+@@ -521,6 +525,8 @@ char *parse_mount_options(ntfs_fuse_context_t *ctx,
+                        * mounted or not.
+                        *      (falling through to default)
+                        */
++                      case OPT_HELP : /* Could lead to unclean condition */
++                      case OPT_VERSION : /* Could lead to unclean condition */
+                       default :
+                               ntfs_log_error("'%s' is an unsupported option.\n",
+                                       poptl->name);
+diff --git a/src/ntfs-3g_common.h b/src/ntfs-3g_common.h
+index 4ed256a3..8ead5107 100644
+--- a/src/ntfs-3g_common.h
++++ b/src/ntfs-3g_common.h
+@@ -94,6 +94,8 @@ enum {
+       OPT_EFS_RAW,
+       OPT_POSIX_NLINK,
+       OPT_SPECIAL_FILES,
++      OPT_HELP,
++      OPT_VERSION,
+ } ;
+
+                       /* Option flags */
meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/ntfs-3g-ntfsprogs_2021.8.22.bb +1 -0
index ca8af163e..ccd18f86c 100644
@@ -9,6 +9,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \
 SRC_URI = "http://tuxera.com/opensource/ntfs-3g_ntfsprogs-${PV}.tgz \
            file://0001-libntfs-3g-Makefile.am-fix-install-failed-while-host.patch \
            file://CVE-2021-46790.patch \
+           file://CVE-2022-30783.patch \
           "
 
 S = "${WORKDIR}/ntfs-3g_ntfsprogs-${PV}"

--
2.17.1

This message contains information that may be privileged or confidential and is the property of the KPIT Technologies Ltd. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. KPIT Technologies Ltd. does not accept any liability for virus infected mails.

#6 lore raw

PATCH 4/8 ntfs-3g-ntfsprogs: Fix CVE-2022-30784

In reply to Ranjith Rathod

From: Omkar Patil <[email protected]>

CVE: CVE-2022-30784

---
 .../ntfs-3g-ntfsprogs/CVE-2022-30784.patch    | 74 +++++++++++++++++++
 .../ntfs-3g-ntfsprogs_2021.8.22.bb            |  1 +
 2 files changed, 75 insertions(+)
 create mode 100644 meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/ntfs-3g-ntfsprogs/CVE-2022-30784.patch
meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/ntfs-3g-ntfsprogs/CVE-2022-30784.patch new file +74 -0
new file mode 100644
index 000000000..ff4ee6df0
@@ -0,0 +1,74 @@
+From 60717a846deaaea47e50ce58872869f7bd1103b5 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Jean-Pierre=20Andr=C3=A9?= <[email protected]>
+Date: Tue, 21 Sep 2021 10:56:06 +0200
+Subject: [PATCH] Avoided allocating and reading an attribute beyond its full
+ size
+
+Before reading a full attribute value for internal use, its expected
+length has been checked to be < 0x40000. However the allocated size
+in the runlist may be much bigger as a consequence of a bug or malice.
+To prevent malloc'ing excessive size, restrict the size of the last
+run to read to the needed length.
+
+CVE: CVE-2022-30784
+Upstream-Status: Backport [http://archive.ubuntu.com/ubuntu/pool/main/n/ntfs-3g/ntfs-3g_2021.8.22-3ubuntu1.1.debian.tar.xz]
+Comment: No change in any hunk
+Signed-off-by: Omkar Patil <[email protected]>
+
+---
+ libntfs-3g/attrib.c | 24 ++++++++++++++++++------
+ 1 file changed, 18 insertions(+), 6 deletions(-)
+
+diff --git a/libntfs-3g/attrib.c b/libntfs-3g/attrib.c
+index 00bfca84..51c8536f 100644
+--- a/libntfs-3g/attrib.c
++++ b/libntfs-3g/attrib.c
+@@ -216,6 +216,7 @@ s64 ntfs_get_attribute_value(const ntfs_volume *vol,
+               if (total + (rl[i].length << vol->cluster_size_bits) >=
+                               sle64_to_cpu(a->data_size)) {
+                       unsigned char *intbuf = NULL;
++                      s64 intlth;
+                       /*
+                        * We have reached the last run so we were going to
+                        * overflow when executing the ntfs_pread() which is
+@@ -229,8 +230,18 @@ s64 ntfs_get_attribute_value(const ntfs_volume *vol,
+                        * We have reached the end of data size so we were
+                        * going to overflow in the same fashion.
+                        * Temporary fix:  same as above.
++                       *
++                       * For safety, limit the amount to read to the
++                       * needed size, knowing that the whole attribute
++                       * size has been checked to be <= 0x40000.
+                        */
+-                      intbuf = ntfs_malloc(rl[i].length << vol->cluster_size_bits);
++                      intlth = (sle64_to_cpu(a->data_size) - total
++                                      + vol->cluster_size - 1)
++                                      >> vol->cluster_size_bits;
++                      if (rl[i].length < intlth)
++                              intlth = rl[i].length;
++                      intbuf = (u8*)ntfs_malloc(intlth
++                                              << vol->cluster_size_bits);
+                       if (!intbuf) {
+                               free(rl);
+                               return 0;
+@@ -246,14 +257,15 @@ s64 ntfs_get_attribute_value(const ntfs_volume *vol,
+                        * - Yes we can, in sparse files! But not necessarily
+                        * size of 16, just run length.
+                        */
+-                      r = ntfs_pread(vol->dev, rl[i].lcn <<
+-                                      vol->cluster_size_bits, rl[i].length <<
+-                                      vol->cluster_size_bits, intbuf);
+-                      if (r != rl[i].length << vol->cluster_size_bits) {
++                      r = ntfs_pread(vol->dev,
++                                      rl[i].lcn << vol->cluster_size_bits,
++                                      intlth << vol->cluster_size_bits,
++                                      intbuf);
++                      if (r != intlth << vol->cluster_size_bits) {
+ #define ESTR "Error reading attribute value"
+                               if (r == -1)
+                                       ntfs_log_perror(ESTR);
+-                              else if (r < rl[i].length <<
++                              else if (r < intlth <<
+                                               vol->cluster_size_bits) {
+                                       ntfs_log_debug(ESTR ": Ran out of input data.\n");
+                                       errno = EIO;
meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/ntfs-3g-ntfsprogs_2021.8.22.bb +1 -0
index ccd18f86c..9e233e127 100644
@@ -10,6 +10,7 @@ SRC_URI = "http://tuxera.com/opensource/ntfs-3g_ntfsprogs-${PV}.tgz \
            file://0001-libntfs-3g-Makefile.am-fix-install-failed-while-host.patch \
            file://CVE-2021-46790.patch \
            file://CVE-2022-30783.patch \
+           file://CVE-2022-30784.patch \
           "
 
 S = "${WORKDIR}/ntfs-3g_ntfsprogs-${PV}"

--
2.17.1

This message contains information that may be privileged or confidential and is the property of the KPIT Technologies Ltd. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. KPIT Technologies Ltd. does not accept any liability for virus infected mails.

#7 lore raw

PATCH 5/8 ntfs-3g-ntfsprogs: Add Patch For Multiple CVE

In reply to Ranjith Rathod

From: Omkar Patil <[email protected]>

Fixed CVE's:
CVE-2022-30785
CVE-2022-30787

---
 .../CVE-2022-30785_30787.patch                | 32 +++++++++++++++++++
 .../ntfs-3g-ntfsprogs_2021.8.22.bb            |  1 +
 2 files changed, 33 insertions(+)
 create mode 100644 meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/ntfs-3g-ntfsprogs/CVE-2022-30785_30787.patch
meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/ntfs-3g-ntfsprogs/CVE-2022-30785_30787.patch new file +32 -0
new file mode 100644
index 000000000..ae71e8ccf
@@ -0,0 +1,32 @@
+From fb28eef6f1c26170566187c1ab7dc913a13ea43c Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Jean-Pierre=20Andr=C3=A9?= <[email protected]>
+Date: Tue, 10 May 2022 10:48:18 +0200
+Subject: [PATCH] Hardened the checking of directory offset requested by a
+ readdir
+
+When asked for the next directory entries, make sure the chunk offset
+is within valid values, otherwise return no more entries in chunk.
+
+CVE: CVE-2022-30785
+CVE: CVE-2022-30787
+Upstream-Status: Backport [http://archive.ubuntu.com/ubuntu/pool/main/n/ntfs-3g/ntfs-3g_2021.8.22-3ubuntu1.1.debian.tar.xz]
+Comment: No change in any hunk
+Signed-off-by: Omkar Patil <[email protected]>
+
+---
+ libfuse-lite/fuse.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libfuse-lite/fuse.c b/libfuse-lite/fuse.c
+index 6f9242b7..3d653e63 100644
+--- a/libfuse-lite/fuse.c
++++ b/libfuse-lite/fuse.c
+@@ -2223,7 +2223,7 @@ static void fuse_lib_readdir(fuse_req_t req, fuse_ino_t ino, size_t size,
+         }
+     }
+     if (dh->filled) {
+-        if (off < dh->len) {
++        if ((off >= 0) && (off < dh->len)) {
+             if (off + size > dh->len)
+                 size = dh->len - off;
+         } else
meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/ntfs-3g-ntfsprogs_2021.8.22.bb +1 -0
index 9e233e127..ea8607e6d 100644
@@ -11,6 +11,7 @@ SRC_URI = "http://tuxera.com/opensource/ntfs-3g_ntfsprogs-${PV}.tgz \
            file://CVE-2021-46790.patch \
            file://CVE-2022-30783.patch \
            file://CVE-2022-30784.patch \
+           file://CVE-2022-30785_30787.patch \
           "
 
 S = "${WORKDIR}/ntfs-3g_ntfsprogs-${PV}"

--
2.17.1

This message contains information that may be privileged or confidential and is the property of the KPIT Technologies Ltd. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. KPIT Technologies Ltd. does not accept any liability for virus infected mails.

#8 lore raw

PATCH 6/8 ntfs-3g-ntfsprogs: Fix CVE-2022-30786

In reply to Ranjith Rathod

From: Omkar Patil <[email protected]>

CVE: CVE-2022-30786

---
 .../ntfs-3g-ntfsprogs/CVE-2022-30786-1.patch  | 36 +++++++++++++++
 .../ntfs-3g-ntfsprogs/CVE-2022-30786-2.patch  | 45 +++++++++++++++++++
 .../ntfs-3g-ntfsprogs_2021.8.22.bb            |  2 +
 3 files changed, 83 insertions(+)
 create mode 100644 meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/ntfs-3g-ntfsprogs/CVE-2022-30786-1.patch
 create mode 100644 meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/ntfs-3g-ntfsprogs/CVE-2022-30786-2.patch
meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/ntfs-3g-ntfsprogs/CVE-2022-30786-1.patch new file +36 -0
new file mode 100644
index 000000000..9d485fed8
@@ -0,0 +1,36 @@
+From 838b6e35b43062353998853eab50cd0675201ed7 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Jean-Pierre=20Andr=C3=A9?= <[email protected]>
+Date: Tue, 21 Sep 2021 10:54:50 +0200
+Subject: [PATCH] Made sure there is no null character in an attribute name
+
+When copying an attribute name which contains a null, it is truncated
+and this may lead to accessing non-allocated bytes when relying on the
+expected name length. Such names must therefore be rejected.
+
+CVE: CVE-2022-30786
+Upstream-Status: Backport [http://archive.ubuntu.com/ubuntu/pool/main/n/ntfs-3g/ntfs-3g_2021.8.22-3ubuntu1.1.debian.tar.xz]
+Comment: No change in any hunk
+Signed-off-by: Omkar Patil <[email protected]>
+
+---
+ libntfs-3g/attrib.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+--- a/libntfs-3g/attrib.c
++++ b/libntfs-3g/attrib.c
+@@ -426,7 +426,15 @@ ntfs_attr *ntfs_attr_open(ntfs_inode *ni
+       na = ntfs_calloc(sizeof(ntfs_attr));
+       if (!na)
+               goto out;
++      if (!name_len)
++              name = (ntfschar*)NULL;
+       if (name && name != AT_UNNAMED && name != NTFS_INDEX_I30) {
++              /* A null char leads to a short name and unallocated bytes */
++              if (ntfs_ucsnlen(name, name_len) != name_len) {
++                      ntfs_log_error("Null character in attribute name"
++                              " of inode %lld\n",(long long)ni->mft_no);
++                      goto err_out;
++              }
+               name = ntfs_ucsndup(name, name_len);
+               if (!name)
+                       goto err_out;
meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/ntfs-3g-ntfsprogs/CVE-2022-30786-2.patch new file +45 -0

45 lines not on this page · raw message

meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/ntfs-3g-ntfsprogs_2021.8.22.bb +2 -0
index ea8607e6d..f74e91c93 100644
@@ -12,6 +12,8 @@ SRC_URI = "http://tuxera.com/opensource/ntfs-3g_ntfsprogs-${PV}.tgz \
            file://CVE-2022-30783.patch \
            file://CVE-2022-30784.patch \
            file://CVE-2022-30785_30787.patch \
+           file://CVE-2022-30786-1.patch \
+           file://CVE-2022-30786-2.patch \
           "
 
 S = "${WORKDIR}/ntfs-3g_ntfsprogs-${PV}"

--
2.17.1

This message contains information that may be privileged or confidential and is the property of the KPIT Technologies Ltd. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. KPIT Technologies Ltd. does not accept any liability for virus infected mails.

#9 lore raw

PATCH 7/8 ntfs-3g-ntfsprogs: Fix CVE-2022-30788

In reply to Ranjith Rathod

From: Omkar Patil <[email protected]>

CVE: CVE-2022-30788

---
 .../ntfs-3g-ntfsprogs/CVE-2022-30788-1.patch  | 51 +++++++++++++++++++
 .../ntfs-3g-ntfsprogs/CVE-2022-30788-2.patch  | 30 +++++++++++
 .../ntfs-3g-ntfsprogs_2021.8.22.bb            |  2 +
 3 files changed, 83 insertions(+)
 create mode 100644 meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/ntfs-3g-ntfsprogs/CVE-2022-30788-1.patch
 create mode 100644 meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/ntfs-3g-ntfsprogs/CVE-2022-30788-2.patch
meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/ntfs-3g-ntfsprogs/CVE-2022-30788-1.patch new file +51 -0
new file mode 100644
index 000000000..fc10af53f
@@ -0,0 +1,51 @@
+From a8818cf779d3a32f2f52337c6f258c16719625a3 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Jean-Pierre=20Andr=C3=A9?= <[email protected]>
+Date: Tue, 21 Sep 2021 10:53:16 +0200
+Subject: [PATCH] Used a default usn when the former one cannot be retrieved
+
+When creating a new MFT record, the former seq_no and usn are retrieved
+to avoid the new one to be mistaken for the former one.
+This may not be possible when the record is used for the first time
+or after some bad error. In such situation use default values.
+
+CVE: CVE-2022-30788
+Upstream-Status: Backport [http://archive.ubuntu.com/ubuntu/pool/main/n/ntfs-3g/ntfs-3g_2021.8.22-3ubuntu1.1.debian.tar.xz]
+Comment: No change in any hunk
+Signed-off-by: Omkar Patil <[email protected]>
+
+---
+ libntfs-3g/mft.c | 13 +++++++++++--
+ 1 file changed, 11 insertions(+), 2 deletions(-)
+
+diff --git a/libntfs-3g/mft.c b/libntfs-3g/mft.c
+index d0a601ff..5052d1ec 100644
+--- a/libntfs-3g/mft.c
++++ b/libntfs-3g/mft.c
+@@ -5,7 +5,7 @@
+  * Copyright (c) 2004-2005 Richard Russon
+  * Copyright (c) 2004-2008 Szabolcs Szakacsits
+  * Copyright (c)      2005 Yura Pakhuchiy
+- * Copyright (c) 2014-2018 Jean-Pierre Andre
++ * Copyright (c) 2014-2021 Jean-Pierre Andre
+  *
+  * This program/include file is free software; you can redistribute it and/or
+  * modify it under the terms of the GNU General Public License as published
+@@ -1529,8 +1529,17 @@ ntfs_inode *ntfs_mft_rec_alloc(ntfs_volume *vol, BOOL mft_data)
+               goto undo_mftbmp_alloc;
+       }
+
++              /*
++               * Retrieve the former seq_no and usn so that the new record
++               * cannot be mistaken for the former one.
++               * However the original record may just be garbage, so
++               * use some sensible value when they cannot be retrieved.
++               */
+       seq_no = m->sequence_number;
+-      usn = *(le16*)((u8*)m + le16_to_cpu(m->usa_ofs));
++      if (le16_to_cpu(m->usa_ofs) <= (NTFS_BLOCK_SIZE - 2))
++              usn = *(le16*)((u8*)m + le16_to_cpu(m->usa_ofs & -2));
++      else
++              usn = const_cpu_to_le16(1);
+       if (ntfs_mft_record_layout(vol, bit, m)) {
+               ntfs_log_error("Failed to re-format mft record.\n");
+               free(m);
meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/ntfs-3g-ntfsprogs/CVE-2022-30788-2.patch new file +30 -0
new file mode 100644
index 000000000..4759296a2
@@ -0,0 +1,30 @@
+From bce5734a757fd59d70a52f4d4fe9abe260629b3a Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Jean-Pierre=20Andr=C3=A9?= <[email protected]>
+Date: Tue, 10 May 2022 10:40:17 +0200
+Subject: [PATCH] Fixed operation on little endian data
+
+Forcing an even usa_of, in a recent security patch, must be made on cpu
+endian data.
+
+CVE: CVE-2022-30788
+Upstream-Status: Backport [http://archive.ubuntu.com/ubuntu/pool/main/n/ntfs-3g/ntfs-3g_2021.8.22-3ubuntu1.1.debian.tar.xz]
+Comment: No change in any hunk
+Signed-off-by: Omkar Patil <[email protected]>
+
+---
+ libntfs-3g/mft.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libntfs-3g/mft.c b/libntfs-3g/mft.c
+index 5052d1ec..aefbb5f1 100644
+--- a/libntfs-3g/mft.c
++++ b/libntfs-3g/mft.c
+@@ -1537,7 +1537,7 @@ ntfs_inode *ntfs_mft_rec_alloc(ntfs_volume *vol, BOOL mft_data)
+                */
+       seq_no = m->sequence_number;
+       if (le16_to_cpu(m->usa_ofs) <= (NTFS_BLOCK_SIZE - 2))
+-              usn = *(le16*)((u8*)m + le16_to_cpu(m->usa_ofs & -2));
++              usn = *(le16*)((u8*)m + (le16_to_cpu(m->usa_ofs) & -2));
+       else
+               usn = const_cpu_to_le16(1);
+       if (ntfs_mft_record_layout(vol, bit, m)) {
meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/ntfs-3g-ntfsprogs_2021.8.22.bb +2 -0
index f74e91c93..0da80f8ff 100644
@@ -14,6 +14,8 @@ SRC_URI = "http://tuxera.com/opensource/ntfs-3g_ntfsprogs-${PV}.tgz \
            file://CVE-2022-30785_30787.patch \
            file://CVE-2022-30786-1.patch \
            file://CVE-2022-30786-2.patch \
+           file://CVE-2022-30788-1.patch \
+           file://CVE-2022-30788-2.patch \
           "
 
 S = "${WORKDIR}/ntfs-3g_ntfsprogs-${PV}"

--
2.17.1

This message contains information that may be privileged or confidential and is the property of the KPIT Technologies Ltd. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. KPIT Technologies Ltd. does not accept any liability for virus infected mails.

#10 lore raw

PATCH 8/8 ntfs-3g-ntfsprogs: Fix CVE-2022-30789

In reply to Ranjith Rathod

From: Omkar Patil <[email protected]>

CVE: CVE-2022-30789

---
 .../ntfs-3g-ntfsprogs/CVE-2022-30789.patch    | 68 +++++++++++++++++++
 .../ntfs-3g-ntfsprogs_2021.8.22.bb            |  1 +
 2 files changed, 69 insertions(+)
 create mode 100644 meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/ntfs-3g-ntfsprogs/CVE-2022-30789.patch
meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/ntfs-3g-ntfsprogs/CVE-2022-30789.patch new file +68 -0
new file mode 100644
index 000000000..0ee3b7ae3
@@ -0,0 +1,68 @@
+From 6efc1305c1951c1d72181f449f2fab68fa25fae8 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Jean-Pierre=20Andr=C3=A9?= <[email protected]>
+Date: Wed, 20 Oct 2021 09:53:28 +0200
+Subject: [PATCH] Made sure the client log data does not overflow from restart
+ page
+
+Strengthen the consistency check of the length of restart pages, and
+check that log client records are within such a restart page.
+
+CVE: CVE-2022-30789
+Upstream-Status: Backport [http://archive.ubuntu.com/ubuntu/pool/main/n/ntfs-3g/ntfs-3g_2021.8.22-3ubuntu1.1.debian.tar.xz]
+Comment: No change in any hunk
+Signed-off-by: Omkar Patil <[email protected]>
+
+---
+ libntfs-3g/logfile.c | 21 +++++++++++++++++++++
+ 1 file changed, 21 insertions(+)
+
+diff --git a/libntfs-3g/logfile.c b/libntfs-3g/logfile.c
+index adc0557f..9c3155e7 100644
+--- a/libntfs-3g/logfile.c
++++ b/libntfs-3g/logfile.c
+@@ -287,9 +287,19 @@ static BOOL ntfs_check_log_client_array(RESTART_PAGE_HEADER *rp)
+       LOG_CLIENT_RECORD *ca, *cr;
+       u16 nr_clients, idx;
+       BOOL in_free_list, idx_is_first;
++      u32 offset_clients;
+
+       ntfs_log_trace("Entering.\n");
++              /* The restart area must be fully within page */
++      if ((le16_to_cpu(rp->restart_area_offset) + sizeof(RESTART_AREA))
++                      > le32_to_cpu(rp->system_page_size))
++              goto err_out;
+       ra = (RESTART_AREA*)((u8*)rp + le16_to_cpu(rp->restart_area_offset));
++      offset_clients = le16_to_cpu(rp->restart_area_offset)
++                      + le16_to_cpu(ra->client_array_offset);
++              /* The clients' records must begin within page */
++      if (offset_clients >= le32_to_cpu(rp->system_page_size))
++              goto err_out;
+       ca = (LOG_CLIENT_RECORD*)((u8*)ra +
+                       le16_to_cpu(ra->client_array_offset));
+       /*
+@@ -308,6 +318,10 @@ static BOOL ntfs_check_log_client_array(RESTART_PAGE_HEADER *rp)
+                       idx = le16_to_cpu(cr->next_client)) {
+               if (!nr_clients || idx >= le16_to_cpu(ra->log_clients))
+                       goto err_out;
++                      /* The client record must be fully within page */
++              if ((offset_clients + (idx + 1)*sizeof(LOG_CLIENT_RECORD))
++                              > le32_to_cpu(rp->system_page_size))
++                      goto err_out;
+               /* Set @cr to the current log client record. */
+               cr = ca + idx;
+               /* The first log client record must not have a prev_client. */
+@@ -380,7 +394,14 @@ static int ntfs_check_and_load_restart_page(ntfs_attr *log_na,
+       /*
+        * Allocate a buffer to store the whole restart page so we can multi
+        * sector transfer deprotect it.
++       * For safety, make sure this is consistent with the usa_count
++       * and shorter than the full log size
+        */
++      if ((le32_to_cpu(rp->system_page_size)
++                      > (u32)(le16_to_cpu(rp->usa_count) - 1)*NTFS_BLOCK_SIZE)
++         || (le32_to_cpu(rp->system_page_size)
++                      > le64_to_cpu(log_na->data_size)))
++              return (EINVAL);
+       trp = ntfs_malloc(le32_to_cpu(rp->system_page_size));
+       if (!trp)
+               return errno;
meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/ntfs-3g-ntfsprogs_2021.8.22.bb +1 -0
index 0da80f8ff..c926d6ddd 100644
@@ -16,6 +16,7 @@ SRC_URI = "http://tuxera.com/opensource/ntfs-3g_ntfsprogs-${PV}.tgz \
            file://CVE-2022-30786-2.patch \
            file://CVE-2022-30788-1.patch \
            file://CVE-2022-30788-2.patch \
+           file://CVE-2022-30789.patch \
           "
 
 S = "${WORKDIR}/ntfs-3g_ntfsprogs-${PV}"

--
2.17.1

This message contains information that may be privileged or confidential and is the property of the KPIT Technologies Ltd. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. KPIT Technologies Ltd. does not accept any liability for virus infected mails.