Linux MIPS Architecture development
 help / color / mirror / Atom feed
* Fix zero length sys_cacheflush
@ 2005-10-19 10:57 Atsushi Nemoto
  2005-10-19 13:29 ` Ralf Baechle
  0 siblings, 1 reply; 4+ messages in thread
From: Atsushi Nemoto @ 2005-10-19 10:57 UTC (permalink / raw)
  To: linux-mips; +Cc: ralf

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;
 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-10-19 15:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-19 10:57 Fix zero length sys_cacheflush Atsushi Nemoto
2005-10-19 13:29 ` Ralf Baechle
2005-10-19 14:22   ` Atsushi Nemoto
2005-10-19 15:57     ` Ralf Baechle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox