| To: | linux-mips@linux-mips.org |
|---|---|
| Subject: | Fix zero length sys_cacheflush |
| From: | Atsushi Nemoto <anemo@mba.ocn.ne.jp> |
| Date: | Wed, 19 Oct 2005 19:57:14 +0900 (JST) |
| Cc: | ralf@linux-mips.org |
| Original-recipient: | rfc822;linux-mips@linux-mips.org |
| Sender: | linux-mips-bounce@linux-mips.org |
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).
Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
diff --git a/arch/mips/mm/cache.c b/arch/mips/mm/cache.c
--- a/arch/mips/mm/cache.c
+++ b/arch/mips/mm/cache.c
@@ -56,6 +56,8 @@ EXPORT_SYMBOL(_dma_cache_inv);
asmlinkage int sys_cacheflush(unsigned long __user addr,
unsigned long bytes, unsigned int cache)
{
+ if (bytes == 0)
+ return 0;
if (!access_ok(VERIFY_WRITE, (void __user *) addr, bytes))
return -EFAULT;
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: [Patch] Fix lookup_dcookie for MIPS o32, Ralf Baechle |
|---|---|
| Next by Date: | Re: [Patch] Fix lookup_dcookie for MIPS o32, Geert Uytterhoeven |
| Previous by Thread: | Malta on Linux 2.6.14_rc1, hmc0116 |
| Next by Thread: | Re: Fix zero length sys_cacheflush, Ralf Baechle |
| Indexes: | [Date] [Thread] [Top] [All Lists] |