lkml.org 
[lkml]   [2014]   [May]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 4/4] test: validate sysctl_writes_strict
From
On Sat, May 3, 2014 at 7:42 AM, Randy Dunlap <rdunlap@infradead.org> wrote:
> On 05/01/2014 02:26 PM, Kees Cook wrote:
>>
>> This adds several behavioral tests to sysctl string and number writing
>> to detect unexpected cases that behaved differently when the sysctl
>> kernel.sysctl_writes_strict != 1.
>>
>>
>> Signed-off-by: Kees Cook <keescook@chromium.org>
>> ---
>> kernel/sysctl.c | 4 +-
>> tools/testing/selftests/Makefile | 1 +
>> tools/testing/selftests/sysctl/Makefile | 19 ++++
>> tools/testing/selftests/sysctl/common_tests | 109
>> +++++++++++++++++++++++
>> tools/testing/selftests/sysctl/run_numerictests | 10 +++
>> tools/testing/selftests/sysctl/run_stringtests | 77 ++++++++++++++++
>> 6 files changed, 218 insertions(+), 2 deletions(-)
>> create mode 100644 tools/testing/selftests/sysctl/Makefile
>> create mode 100644 tools/testing/selftests/sysctl/common_tests
>> create mode 100644 tools/testing/selftests/sysctl/run_numerictests
>> create mode 100644 tools/testing/selftests/sysctl/run_stringtests
>>
>> diff --git a/kernel/sysctl.c b/kernel/sysctl.c
>> index d5bee7949e4a..51bbf904d694 100644
>> --- a/kernel/sysctl.c
>> +++ b/kernel/sysctl.c
>> @@ -1783,8 +1783,8 @@ static int _proc_do_string(char *data, int maxlen,
>> int write,
>>
>> static void warn_sysctl_write(struct ctl_table *table)
>> {
>> - pr_warn("%s wrote to %s when file position was not 0!\n",
>> - current->task_comm, table->procname);
>> + pr_warn("write to %s by %s used a non-zero file position!\n",
>> + table->procname, current->comm);
>> pr_warn("This will not be supported in the future.\n");
>> pr_warn("To silence warning, set kernel.sysctl_writes_strict =
>> -1\n");
>> }
>
>
> Why is this patch part of the test patch?

Oops, thanks. Yeah, that snuck into the wrong patch.

-Kees

--
Kees Cook
Chrome OS Security


\
 
 \ /
  Last update: 2014-05-06 04:01    [W:0.036 / U:1.600 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site