From: Andrew Morton <akpm@linux-foundation.org>
To: Kees Cook <keescook@chromium.org>
Cc: linux-kernel@vger.kernel.org,
Randy Dunlap <rdunlap@infradead.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
Subject: Re: [PATCH v3 0/4] sysctl: fix incorrect write position handling
Date: Mon, 5 May 2014 15:00:16 -0700 [thread overview]
Message-ID: <20140505150016.6dd7159e6a02b047fe40c56d@linux-foundation.org> (raw)
In-Reply-To: <1398979597-3589-1-git-send-email-keescook@chromium.org>
On Thu, 1 May 2014 14:26:33 -0700 Kees Cook <keescook@chromium.org> wrote:
> When writing to a sysctl string, each write, regardless of VFS position,
> began writing the string from the start. This meant the contents of
> the last write to the sysctl controlled the string contents instead of
> the first.
>
> This misbehavior was featured in an exploit against Chrome OS. While it's
> not in itself a vulnerability, it's a weirdness that isn't on the mind
> of most auditors: "This filter looks correct, the first line written
> would not be meaningful to sysctl" doesn't apply here, since the size
> of the write and the contents of the final write are what matter when
> writing to sysctls.
>
> This adds the sysctl kernel.sysctl_writes_strict to control the write
> behavior. The default (0) reports when VFS position is non-0 on a write,
> but retains legacy behavior, -1 disables the warning, and 1 enables the
> position-respecting behavior.
>
OK, let's try that. I added this paragraph to the patchset's overall
changelog:
: The long-term plan here is to wait for userspace to be fixed in response
: to the new warning and to then switch the default kernel behavior to the
: new position-respecting behavior.
I'm thinking we should use pr_warn_once() in warn_sysctl_write()? Otherwise
people will go and shut the thing up permanently and we'll lose the benefits.
next prev parent reply other threads:[~2014-05-05 22:00 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-01 21:26 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
2014-05-05 22:00 ` Andrew Morton [this message]
2014-05-06 1:28 ` [PATCH v3 0/4] sysctl: fix incorrect write position handling 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=20140505150016.6dd7159e6a02b047fe40c56d@linux-foundation.org \
--to=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=keescook@chromium.org \
--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
Powered by JetHome