Luck, Tony wrote:
This patch allows users to read region 5 from /dev/kmem and enhances range check of it.


I'm uneasy about this change to drivers/char/mem.c.  Won't it stop
those architectures that have memory at physical 0x0 from accessing
it?

Sorry,  I sent wrong patch.
This !ptr check should be done in read_kmem and kmem doesn't have address 0x0.

Another way is
==
#define KMEM_ERR_PTR (void *)-1

if (ptr == KMEM_ERR_PTR)
        return -EFAULT
==
or no check.

By the way, can ia64's copy_to_user(from, buf, size) catch bad "from" ?

Regards,
-- Kamezawa


                ptr = xlate_dev_mem_ptr(p);
-
+               if (!ptr)
+                       return -EFAULT

-Tony
-
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html



-
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to