check if a kernel page is read-only

Valdis.Kletnieks at vt.edu Valdis.Kletnieks at vt.edu
Wed Sep 7 12:48:58 EDT 2016


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...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 830 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20160907/9e553dd9/attachment.bin 


More information about the Kernelnewbies mailing list