+- Kernel code is protected at system level and, unlike data, it doesn't
+ require special attention.
What does this even mean?
+Protection mechanism
+--------------------
+
+- When available, the MMU can write protect memory pages that would be
+ otherwise writable.
Again; what does this really want to say?
+- The protection has page-level granularity.
I don't think Linux supports non-paging MMUs.
+- An attempt to overwrite a protected page will trigger an exception.
+- **Write protected data must go exclusively to write protected pages**
+- **Writable data must go exclusively to writable pages**
WTH is with all those ** ?
Can we ditch all the ** nonsense and put whitespace in there? More paragraphs
and whitespace are more good.
Also, I really don't like how you differentiate between static and
dynamic wr.
We already have RO, why do you need more RO?
+
+ **Remarks:**
+ - The "AUTO" modes perform automatic protection of the content, whenever
+ the current vmap_area is used up and a new one is allocated.
+ - At that point, the vmap_area being phased out is protected.
+ - The size of the vmap_area depends on various parameters.
+ - It might not be possible to know for sure *when* certain data will
+ be protected.
Surely that is a problem?
+ - The functionality is provided as tradeoff between hardening and speed.
Which you fail to explain.
+ - Its usefulness depends on the specific use case at hand
How about you write sensible text inside the option descriptions
instead?
This is not a presentation; less bullets, more content.
+- Not only the pmalloc memory must be protected, but also any reference to
+ it that might become the target for an attack. The attack would replace
+ a reference to the protected memory with a reference to some other,
+ unprotected, memory.
I still don't really understand the whole write-rare thing; how does it
really help? If we can write in kernel memory, we can write to
page-tables too.
And I don't think this document even begins to explain _why_ you're
doing any of this. How does it help?
+- The users of rare write must take care of ensuring the atomicity of the
+ action, respect to the way they use the data being altered; for example,
+ take a lock before making a copy of the value to modify (if it's
+ relevant), then alter it, issue the call to rare write and finally
+ release the lock. Some special scenario might be exempt from the need
+ for locking, but in general rare-write must be treated as an operation
+ that can incur into races.
What?!