Re: [patch] x86: test case for the RODATA config option

From: Ingo Molnar
Date: Tue Jan 22 2008 - 19:05:25 EST



cool!

could you perhaps also do an add-on:

> + /* test 1: read the value */
> + /* test 2: write to the variable; this should fault */
> + /* test 3: check the value hasn't changed */

test 4: make it writable again
test 5: make it NX -> check that it's not executable

and perhaps also check that normal kernel allocations (kmalloc(), etc.) are NX as well? (with the same section trick you use in
this patch - perhaps try to call a kmalloc()-ed buffer that contains a
'ret' instruction - if that call faults then the test is OK, if the call
succeeds then the test failed.)

Ingo
--
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/