Skip to contentSkip to conversation

ocfs2-fix-null-pointer-dereference-in-ocfs2_dir_foreach_blk_id-fix.patch removed from -mm tree

folded-merged [email protected] 1 participant 1 message Aug 13, 2013 OCFS2

lore
Share & tools
lore
#0 lore raw

Subject: [folded-merged] ocfs2-fix-null-pointer-dereference-in-ocfs2_dir_foreach_blk_id-fix.patch removed from -mm tree
To: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected]
From: [email protected]
Date: Tue, 13 Aug 2013 15:57:50 -0700

The patch titled
Subject: ocfs2: ocfs2: fix recent memory corruption bug
has been removed from the -mm tree. Its filename was
ocfs2-fix-null-pointer-dereference-in-ocfs2_dir_foreach_blk_id-fix.patch

This patch was dropped because it was folded into ocfs2-fix-null-pointer-dereference-in-ocfs2_dir_foreach_blk_id.patch

------------------------------------------------------
From: Dan Carpenter <[email protected]>
Subject: ocfs2: ocfs2: fix recent memory corruption bug

The pointer math in 6fdf3af1d2 "ocfs2: fix null pointer dereference in ocfs2_dir_foreach_blk_id()" isn't correct so it will zero out the wrong memory. In fact, the memset isn't needed because the initializer will set all these values to zero.

This patch also removes the "ctx.pos = 0" initialization because that will be zeroed automatically as well.

---

 fs/ocfs2/dir.c |    4 ----
 1 file changed, 4 deletions(-)
fs/ocfs2/dir.c renamed from fs/ocfs2/dir.c~ocfs2-fix-null-pointer-dereference-in-ocfs2_dir_foreach_blk_id-fix +0 -3
diff -puN fs/ocfs2/dir.c~ocfs2-fix-null-pointer-dereference-in-ocfs2_dir_foreach_blk_id-fix fs/ocfs2/dir.c
@@ -2154,12 +2154,8 @@ int ocfs2_empty_dir(struct inode *inode)
 	int ret;
 	struct ocfs2_empty_dir_priv priv = {
 		.ctx.actor = ocfs2_empty_dir_filldir,
-		.ctx.pos = 0,
 	};
 
-	memset(&priv + sizeof(struct dir_context), 0,
-	       sizeof(priv) - sizeof(struct dir_context));