KSPP / linux

Linux kernel source tree (Kernel Self Protection Project)
https://kernsec.org/wiki/index.php/Kernel_Self_Protection_Project
Other
81 stars 5 forks source link

lkdtm EXEC_RODATA reports FAIL when execution succeed. Is that correct ? #167

Open chleroy opened 2 years ago

chleroy commented 2 years ago

EXEC_RODATA test is cherry on the cake as there is no explicit requirement for not being able to execute rodata at first place:

Caption of CONFIG_STRICT_KERNEL_RWX is "Make kernel text and rodata read-only", which doesn't mean we want rodata to be no-exec, allthough the detailed help text evoques it.

powerpc is really are reluctant to implement no-exec on rodata as it would either require bigger alignment between sections or would require the use of regular pages instead of block mapping, so we'd have to choose between wasted memory or degraded performance.

See https://github.com/linuxppc/linux/commit/d924cc3feda9c2bea8164930899f367ce249cbbf and https://github.com/linuxppc/linux/commit/a0591b60eef965f7f5255ad4696bbba9af4b43d0

EXEC_RODATA lkdtm test says lkdtm: FAIL: func returned Should we report WARN instead of FAIL ?

kees commented 2 years ago

I don't mind adding arch-specific XFAILs, but I considering it a failure: data should not be executable. It's simply a detail of the architecture that this trade-off was chosen.