Re: [PATCH] enable to read region 5 from /dev/kmem

From: KAMEZAWA Hiroyuki <kamezawa.hiroyu_at_jp.fujitsu.com>
Date: 2005-07-12 10:14:29
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 majordomo@vger.kernel.org
> 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 majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Mon Jul 11 20:15:13 2005

This archive was generated by hypermail 2.1.8 : 2005-08-02 09:20:40 EST