On Wed, 07 Sep 2016 15:47:30 +0200, Oscar Salvador said:
> You are right regarding security stuff, but was not my will either
> bypassing memory protections or crashing the system.
Never said that was your intent. The problem is that given that tool, some
other person can abuse your module with that intent.
> - I write a user program which allocates a buffer, then writes something to
> it and calls a my module via read/write
OK, I'll bite - how are you hooking the read/write syscalls to code in your
module? Via a pseudo-device and a struct *file_ops that points at your code?
Oh - while you're at it, make sure your code deals properly with buffers that
cross page boundaries (for instance, a 512 byte buffer that starts at 3840
bytes into a 4K page, and ends 256 bytes into the next page - particularly
fun if the next page is either non-existent or paged out to swap. There's
reasons why the code in copy_(to|from)_user() is ugly...