[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGXu5jJE+o7Rue0-E+UuG_c9+fRJjpjoeN6PpO+upb4yzUxiqA@mail.gmail.com>
Date: Mon, 5 May 2014 18:28:35 -0700
From: Kees Cook <keescook@...omium.org>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: LKML <linux-kernel@...r.kernel.org>,
Randy Dunlap <rdunlap@...radead.org>,
Ingo Molnar <mingo@...nel.org>, Rik van Riel <riel@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Mel Gorman <mgorman@...e.de>,
Aaron Tomlin <atomlin@...hat.com>,
Li Zefan <lizefan@...wei.com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Ryan Mallon <rmallon@...il.com>,
Wanpeng Li <liwanp@...ux.vnet.ibm.com>,
Dario Faggioli <raistlin@...ux.it>, Jens Axboe <axboe@...com>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Frederic Weisbecker <fweisbec@...il.com>,
Michael Ellerman <michael@...erman.id.au>,
"linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>
Subject: Re: [PATCH v3 0/4] sysctl: fix incorrect write position handling
On Mon, May 5, 2014 at 3:00 PM, Andrew Morton <akpm@...ux-foundation.org> wrote:
> On Thu, 1 May 2014 14:26:33 -0700 Kees Cook <keescook@...omium.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.
Great, thanks!
> 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.
I was worried we'd miss different processed tripping it later. On the
other hand, I didn't like the idea of being able to spam dmesg. Do you
want me to send a patch to replace that with pr_warn_once()?
-Kees
--
Kees Cook
Chrome OS Security
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists