Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=450790a2c51e6d9d47ed30dbdcf486656b8e186f
Commit:     450790a2c51e6d9d47ed30dbdcf486656b8e186f
Parent:     cbc89dcfd24fd161f7a8e262266177db160a58fb
Author:     David Chinner <[EMAIL PROTECTED]>
AuthorDate: Wed Feb 6 13:37:40 2008 +1100
Committer:  Lachlan McIlroy <[EMAIL PROTECTED]>
CommitDate: Thu Feb 7 18:24:13 2008 +1100

    [XFS] Fix oops in xfs_file_readdir()
    
    When xfs_file_readdir() exactly fills a buffer, it can move it's index
    past the end of the buffer and dereference it even though the result of
    the dereference is never used. On some platforms this causes an oops.
    
    SGI-PV: 976923
    SGI-Modid: xfs-linux-melb:xfs-kern:30458a
    
    Signed-off-by: David Chinner <[EMAIL PROTECTED]>
    Signed-off-by: Lachlan McIlroy <[EMAIL PROTECTED]>
---
 fs/xfs/linux-2.6/xfs_file.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/fs/xfs/linux-2.6/xfs_file.c b/fs/xfs/linux-2.6/xfs_file.c
index 21a1c2b..edab1ff 100644
--- a/fs/xfs/linux-2.6/xfs_file.c
+++ b/fs/xfs/linux-2.6/xfs_file.c
@@ -350,8 +350,8 @@ xfs_file_readdir(
 
                size = buf.used;
                de = (struct hack_dirent *)buf.dirent;
-               curr_offset = de->offset /* & 0x7fffffff */;
                while (size > 0) {
+                       curr_offset = de->offset /* & 0x7fffffff */;
                        if (filldir(dirent, de->name, de->namlen,
                                        curr_offset & 0x7fffffff,
                                        de->ino, de->d_type)) {
@@ -362,7 +362,6 @@ xfs_file_readdir(
                                       sizeof(u64));
                        size -= reclen;
                        de = (struct hack_dirent *)((char *)de + reclen);
-                       curr_offset = de->offset /* & 0x7fffffff */;
                }
        }
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to