[PATCH] bug in read_ldt()? (resent)

Ulisses ra993482 at ic.unicamp.br
Wed Jun 23 14:00:44 UTC 2004


Hi,

	I think I found a little bug in
linux-2.6.6-1.435/arch/i386/kernel/ldt.c. I'm not sure if you already
have corrected this one, so here is the patch. :-)

Regards,

-- Ulisses

--- arch/i386/kernel/ldt.c.orig Tue Jun 22 17:40:22 2004
+++ arch/i386/kernel/ldt.c      Tue Jun 22 17:40:43 2004
@@ -150,7 +150,7 @@
                bytes = size - i;
                if (bytes > PAGE_SIZE)
                        bytes = PAGE_SIZE;
-               if (copy_to_user(ptr + i, kaddr, size - i))
+               if (copy_to_user(ptr + i, kaddr, bytes))
                        err = -EFAULT;
                kunmap(mm->context.ldt_pages[nr]);
        }






More information about the fedora-devel-list mailing list