linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium.org>
To: Randy Dunlap <rdunlap@infradead.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Ingo Molnar <mingo@kernel.org>, Rik van Riel <riel@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Mel Gorman <mgorman@suse.de>, Aaron Tomlin <atomlin@redhat.com>,
	Li Zefan <lizefan@huawei.com>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	Ryan Mallon <rmallon@gmail.com>,
	Wanpeng Li <liwanp@linux.vnet.ibm.com>,
	Dario Faggioli <raistlin@linux.it>, Jens Axboe <axboe@fb.com>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Michael Ellerman <michael@ellerman.id.au>,
	"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>
Subject: Re: [PATCH 4/4] test: validate sysctl_writes_strict
Date: Mon, 5 May 2014 18:29:49 -0700	[thread overview]
Message-ID: <CAGXu5j+GbUDEsppLcVy+PaQSkX3=rsdyRhw7PbLYj3WMraT1Bg@mail.gmail.com> (raw)
In-Reply-To: <53650053.5050402@infradead.org>

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

  reply	other threads:[~2014-05-06  1:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-01 21:26 [PATCH v3 0/4] sysctl: fix incorrect write position handling Kees Cook
2014-05-01 21:26 ` [PATCH 1/4] sysctl: clean up char buffer arguments Kees Cook
2014-05-01 21:26 ` [PATCH 2/4] sysctl: refactor sysctl string writing logic Kees Cook
2014-05-01 21:26 ` [PATCH 3/4] sysctl: allow for strict write position handling Kees Cook
2014-05-01 21:26 ` [PATCH 4/4] test: validate sysctl_writes_strict Kees Cook
2014-05-03 14:42   ` Randy Dunlap
2014-05-06  1:29     ` Kees Cook [this message]
2014-05-05 22:00 ` [PATCH v3 0/4] sysctl: fix incorrect write position handling Andrew Morton
2014-05-06  1:28   ` Kees Cook

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAGXu5j+GbUDEsppLcVy+PaQSkX3=rsdyRhw7PbLYj3WMraT1Bg@mail.gmail.com' \
    --to=keescook@chromium.org \
    --cc=akpm@linux-foundation.org \
    --cc=atomlin@redhat.com \
    --cc=axboe@fb.com \
    --cc=benh@kernel.crashing.org \
    --cc=dave.hansen@linux.intel.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liwanp@linux.vnet.ibm.com \
    --cc=lizefan@huawei.com \
    --cc=mgorman@suse.de \
    --cc=michael@ellerman.id.au \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=raistlin@linux.it \
    --cc=rdunlap@infradead.org \
    --cc=riel@redhat.com \
    --cc=rmallon@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).