lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 17 Nov 2021 08:50:15 -0800
From:   Harshad Shirwadkar <harshadshirwadkar@...il.com>
To:     linux-ext4@...r.kernel.org
Cc:     tytso@....edu, Harshad Shirwadkar <harshadshirwadkar@...il.com>
Subject: [PATCH] e2fsck: skip sorting extents if there are no valid extents

From: Harshad Shirwadkar <harshadshirwadkar@...il.com>

At the end of a fast commit replay, e2fsck tries merging extents in a
inode. This patch fixes a bug in this logic where we were continuing
this action even if there were no extents to merge resulting in
accessing illegal memory.

Signed-off-by: Harshad Shirwadkar <harshadshirwadkar@...il.com>
---
 e2fsck/journal.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/e2fsck/journal.c b/e2fsck/journal.c
index fe4e018d..2e867234 100644
--- a/e2fsck/journal.c
+++ b/e2fsck/journal.c
@@ -464,6 +464,9 @@ static void ex_sort_and_merge(struct extent_list *list)
 		}
 	}
 
+	if (list->count == 0)
+		return;
+
 	/* Now sort by logical offset */
 	qsort(list->extents, list->count, sizeof(list->extents[0]),
 		ex_compar);
-- 
2.34.0.rc1.387.gb447b232ab-goog

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ