From: Andrei Borzenkov Date: Sat, 9 Jan 2016 15:55:55 +0000 (+0300) Subject: xfs: fix possible inode corruption in directory scan X-Git-Tag: 2.02-beta3~98 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aafd205c926df01b039e588134e3798913bcbe3f;p=thirdparty%2Fgrub.git xfs: fix possible inode corruption in directory scan grub_xfs_iterate_dir did not restore first character after inline name when match was found. Dependning on XFS format this character could be inode number and we could return to the same node later in find_file if processing cycled symlinks. CID: 86724 --- diff --git a/grub-core/fs/xfs.c b/grub-core/fs/xfs.c index a03526b32..ca9c0c37a 100644 --- a/grub-core/fs/xfs.c +++ b/grub-core/fs/xfs.c @@ -775,7 +775,10 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir, c = de->name[de->len]; de->name[de->len] = '\0'; if (iterate_dir_call_hook (ino, de->name, &ctx)) - return 1; + { + de->name[de->len] = c; + return 1; + } de->name[de->len] = c; de = grub_xfs_inline_next_de(dir->data, head, de);