grub-devel.gnu.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: grub-devel@gnu.org
Cc: Jan Kara <jack@suse.cz>
Subject: [PATCH 2/4] xfs: Fix termination loop for directory iteration
Date: Mon, 14 Jul 2014 17:21:29 +0200	[thread overview]
Message-ID: <1405351291-24767-3-git-send-email-jack@suse.cz> (raw)
In-Reply-To: <1405351291-24767-1-git-send-email-jack@suse.cz>

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 <jack@suse.cz>
---
 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



  parent reply	other threads:[~2014-07-14 15:21 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-14 15:21 [PATCH 0/4] Support for XFS v5 superblock Jan Kara
2014-07-14 15:21 ` [PATCH 1/4] xfs: Add helper for inode size Jan Kara
2015-05-11 11:53   ` Andrei Borzenkov
2015-05-11 12:15     ` Jan Kara
2015-05-12  5:26       ` Andrei Borzenkov
2015-05-12  8:07         ` Jan Kara
2014-07-14 15:21 ` Jan Kara [this message]
2015-05-11 11:49   ` [PATCH 2/4] xfs: Fix termination loop for directory iteration Andrei Borzenkov
2014-07-14 15:21 ` [PATCH 3/4] xfs: Convert inode numbers to cpu endianity immediately after reading Jan Kara
2015-05-12  5:22   ` Andrei Borzenkov
2014-07-14 15:21 ` [PATCH 4/4] xfs: V5 filesystem format support Jan Kara
2015-05-12  5:23   ` Andrei Borzenkov
2015-05-12 13:47     ` Jan Kara
2015-05-13  4:50       ` Andrei Borzenkov
2015-05-13  7:12         ` Jan Kara
2014-07-21 17:31 ` [PATCH 0/4] Support for XFS v5 superblock Jan Kara
2014-07-21 21:42   ` Vladimir 'φ-coder/phcoder' Serbinenko
2014-09-23  7:39 ` Jan Kara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1405351291-24767-3-git-send-email-jack@suse.cz \
    --to=jack@suse.cz \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).