tools/testing/selftests/sysctl: Add pre-check to the value of writes_strict
authorOrson Zhai <orson.zhai@linaro.org>
Tue, 27 Jun 2017 00:52:09 +0000 (08:52 +0800)
committerShuah Khan <shuahkh@osg.samsung.com>
Wed, 28 Jun 2017 00:57:02 +0000 (18:57 -0600)
commitd644437a1dc6226afb7b8a814657961d8812f763
treeebc2b66ea461f99acb82da3103ac82a88d35991e
parentfde662d9c3e09ba54273785de4e12628b7bd9de1
tools/testing/selftests/sysctl: Add pre-check to the value of writes_strict

Sysctl test will fail in some items if the value of /proc/sys/kernel
/sysctrl_writes_strict is 0 as the default value in kernel older than v4.5.

Make this test more robus and compatible with older kernel by checking and
update writes_strict value and restore it when test is done.

Signed-off-by: Orson Zhai <orson.zhai@linaro.org>
Reviewed-by: Sumit Semwal <sumit.semwal@linaro.org>
Tested-by: Sumit Semwal <sumit.semwal@linaro.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
tools/testing/selftests/sysctl/common_tests
tools/testing/selftests/sysctl/run_numerictests
tools/testing/selftests/sysctl/run_stringtests