Memory trample when using /dev/mem
From: Hu Keping
Date: Sat Oct 11 2014 - 04:52:35 EST
Recently, I run a little testcase about using mmap to check
some physical address.What I found was that the different task can
read and write the same physical address at the same time.
I make proc1 to access 0x20000000, read and write "512" to
that address every 2 seconds. Meanwhile,I make proc2 to access
0x200000000, read and write "1024" to that address every 1 seconds.
The output is a mess, though it needs not be worry on this case,
but what about the proc1 and proc2 are both driver, and they mmap to the
same physical address?
As there are many drivers using /dev/mem and we can not
make sure that the different task will not trample on
each others memory.Shall we add some printk to help locating the problem
when error happened?
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/