linux-mips
[Top] [All Lists]

Re: Fix zero length sys_cacheflush

To: ralf@linux-mips.org
Subject: Re: Fix zero length sys_cacheflush
From: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Date: Wed, 19 Oct 2005 23:22:22 +0900 (JST)
Cc: linux-mips@linux-mips.org
In-reply-to: <20051019132902.GE2616@linux-mips.org>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <20051019.195714.89066462.nemoto@toshiba-tops.co.jp> <20051019132902.GE2616@linux-mips.org>
Sender: linux-mips-bounce@linux-mips.org
>>>>> On Wed, 19 Oct 2005 14:29:02 +0100, Ralf Baechle <ralf@linux-mips.org> 
>>>>> said:

>> I found cacheflush(0, 0, 0) will crash the system.
>> 
>> This is because flush_icache_range(start, end) tries to flushing
>> whole address space (0 - ffffffff) if both start and end are zero
>> (at least in c-r4k.c).

ralf> Applied,

Thanks.

BTW, sparse complains for this "unsigned long __user addr".

asmlinkage int sys_cacheflush(unsigned long __user addr,
        unsigned long bytes, unsigned int cache)

/work/git/linux-mips/arch/mips/mm/cache.c:59:7: warning: dereference of noderef 
expression

I suppose the "unsigned long __user addr" means that the "addr"
variable itself is an userspace object.  So its usage is wrong, isn't
it?

---
Atsushi Nemoto

<Prev in Thread] Current Thread [Next in Thread>