X-Git-Url: https://git.tld-linux.org/?p=packages%2Fgrub2.git;a=blobdiff_plain;f=grub2-xfs-Fix-termination-loop-for-directory-iteration.patch;fp=grub2-xfs-Fix-termination-loop-for-directory-iteration.patch;h=a35fc938a08281fd1a802be0e8d1a9ba3fb9b43f;hp=0000000000000000000000000000000000000000;hb=9d17de0887ee48f66be4e47be43f8fc6a4ea7799;hpb=f70448640b83ae5ebec0579e4b9ecee8c405bb22 diff --git a/grub2-xfs-Fix-termination-loop-for-directory-iteration.patch b/grub2-xfs-Fix-termination-loop-for-directory-iteration.patch new file mode 100644 index 0000000..a35fc93 --- /dev/null +++ b/grub2-xfs-Fix-termination-loop-for-directory-iteration.patch @@ -0,0 +1,32 @@ +From a7d584c005bde09bb86475a79d714215b3480821 Mon Sep 17 00:00:00 2001 +From: Jan Kara +Date: Wed, 11 Jun 2014 18:36:59 +0200 +Subject: [PATCH 2/4] xfs: Fix termination loop for directory iteration + +Directory iteration used wrong position (sizeof wrong structure) for +termination of iteration inside a directory block. Luckily the position +ended up being wrong by just 1 byte and directory entries are larger so +things worked out fine in practice. But fix the problem anyway. + +Signed-off-by: Jan Kara +--- + grub-core/fs/xfs.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/grub-core/fs/xfs.c b/grub-core/fs/xfs.c +index a2fc942707c1..ef3bc787e968 100644 +--- a/grub-core/fs/xfs.c ++++ b/grub-core/fs/xfs.c +@@ -608,8 +608,7 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir, + - grub_be_to_cpu32 (tail->leaf_stale)); + + /* Iterate over all entries within this block. */ +- while (pos < (dirblk_size +- - (int) sizeof (struct grub_xfs_dir2_entry))) ++ while (pos < tail_start) + { + struct grub_xfs_dir2_entry *direntry; + grub_uint8_t *freetag; +-- +1.8.1.4 +