summaryrefslogtreecommitdiff
path: root/tools/testing
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2020-06-25 23:37:01 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-08-19 09:26:29 +0300
commit5397915bf77b63222899dc55e7e76a2c63678a4b (patch)
tree6078e83a065f0e9b0f42115f8e8ad6e7be5ca350 /tools/testing
parentfe1f13b572b23581d49c61036c9ee36e0b0c4382 (diff)
downloadlinux-5397915bf77b63222899dc55e7e76a2c63678a4b.tar.xz
lkdtm: Avoid more compiler optimizations for bad writes
[ Upstream commit 464e86b4abadfc490f426954b431e2ec6a9d7bd2 ] It seems at least Clang is able to throw away writes it knows are destined for read-only memory, which makes things like the WRITE_RO test fail, as the write gets elided. Instead, force the variable to be volatile, and make similar changes through-out other tests in an effort to avoid needing to repeat fixing these kinds of problems. Also includes pr_err() calls in failure paths so that kernel logs are more clear in the failure case. Reported-by: Prasad Sodagudi <psodagud@codeaurora.org> Suggested-by: Sami Tolvanen <samitolvanen@google.com> Fixes: 9ae113ce5faf ("lkdtm: add tests for additional page permissions") Signed-off-by: Kees Cook <keescook@chromium.org> Link: https://lore.kernel.org/r/20200625203704.317097-2-keescook@chromium.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'tools/testing')
0 files changed, 0 insertions, 0 deletions