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>] [day] [month] [year] [list]
Date:	Fri, 19 Nov 2010 16:51:25 +0900
From:	Kazuya Mio <k-mio@...jp.nec.com>
To:	Theodore Tso <tytso@....edu>, ext4 <linux-ext4@...r.kernel.org>
CC:	mkkp4x4@...il.com
Subject: [PATCH] e4defrag: Fix the segfault occurred when removing defragging
 file

Hi,

This is for Red Hat Bugzilla:
https://bugzilla.redhat.com/show_bug.cgi?id=641926

It is possible that e4defrag causes a segfault when someone removes
a defragging file. The following patch fixes this problem.

How to make the newest e4defrag:
1. Download e2fsprogs git tree
   # git pull http://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git

2. Apply the patch I sent a while ago
   http://marc.info/?l=linux-ext4&m=128272690010784&w=4

3. Apply the attached patch 

Regards,
Kazuya Mio

Reported-by: Michal Piotrowski <mkkp4x4@...il.com>
Signed-off-by: Kazuya Mio <k-mio@...jp.nec.com>
---
 misc/e4defrag.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/misc/e4defrag.c b/misc/e4defrag.c
index db92e1c..eb3269a 100644
--- a/misc/e4defrag.c
+++ b/misc/e4defrag.c
@@ -936,7 +936,7 @@ static int get_file_extents(int fd, struct fiemap_extent_list **ext_list_head)
 		fiemap_buf->fm_start = pos;
 		memset(ext_buf, 0, ext_buf_size);
 		ret = ioctl(fd, FS_IOC_FIEMAP, fiemap_buf);
-		if (ret < 0)
+		if (ret < 0 || fiemap_buf->fm_mapped_extents == 0)
 			goto out;
 		for (i = 0; i < fiemap_buf->fm_mapped_extents; i++) {
 			ext_list = NULL;
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ